LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-07-2006, 03:53 PM   #1
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Rep: Reputation: 15
Trying to set up ftp... and failing


Hey all,

I'm trying to set up proftpd on my slack 10.2 box, but everytime I type "ftp localhost" as root I get this error:

Connected to localhost.
421 Service not available, remote server has closed connection
ftp>

I followed the instructions on this page: http://shilo.is-a-geek.com/slack/ftp17.html
and then just copied and pasted the proftpd.conf from http://www.linuxquestions.org/linux/...to_end_ProFTPD and haven't changed a thing...any help?
 
Old 03-07-2006, 04:00 PM   #2
Dragineez
Member
 
Registered: Oct 2005
Location: Annapolis
Distribution: Ubuntu
Posts: 275

Rep: Reputation: 32
Open Port 21

A "connection refused" is different than not being able to connect. You're "connecting" just fine, the box is just refusing to let the connection go through.
 
Old 03-07-2006, 04:03 PM   #3
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Original Poster
Rep: Reputation: 15
So how would I go about fixing that? My router is set up to forward the correct ports...
 
Old 03-07-2006, 04:22 PM   #4
Dragineez
Member
 
Registered: Oct 2005
Location: Annapolis
Distribution: Ubuntu
Posts: 275

Rep: Reputation: 32
Try This

Try running:
Code:
netstat -an |grep LISTEN
Your machine should be listening on 127.0.0.1:21 (or whatever port you've set your ftp server to run on).

I'm assuming, since you tried to connect to localhost that you're running on the machine that is the ftp server. If that's the case, the router isn't involved.
 
Old 03-07-2006, 04:26 PM   #5
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Original Poster
Rep: Reputation: 15
This is the result:

tcp 0 0 0.0.0.0:37 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 1161 /dev/gpmctl

What does that mean?
 
Old 03-08-2006, 09:36 AM   #6
Dragineez
Member
 
Registered: Oct 2005
Location: Annapolis
Distribution: Ubuntu
Posts: 275

Rep: Reputation: 32
No IP Address

That's exceedingly odd. Post the contents of your /etc/hosts file. You should at least have a loopback address defined. On the plus side, it looks like it is listening on port 21.

Can you ping anything from that machine? What happens if you type ifup?

Last edited by Dragineez; 03-08-2006 at 09:59 AM.
 
Old 03-08-2006, 12:27 PM   #7
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Original Poster
Rep: Reputation: 15
/etc/hosts:

Code:
#
# hosts		This file describes a number of hostname-to-address
#		mappings for the TCP/IP subsystem.  It is mostly
#		used at boot time, when no name servers are running.
#		On small systems, this file can be used instead of a
#		"named" name server.  Just add the names, addresses
#		and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine.  It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#

# For loopbacking.
127.0.0.1		localhost
127.0.0.1		Middle-Earth.MiddleEarth Middle-Earth

# End of hosts.
I can ping other machines just fine, I'm only ever on the machine through ssh over the internet...
 
Old 03-08-2006, 01:10 PM   #8
Dragineez
Member
 
Registered: Oct 2005
Location: Annapolis
Distribution: Ubuntu
Posts: 275

Rep: Reputation: 32
Now That's What I Call A Dead Parrott

Have you considered giving this machine a static IP address? It should probably grab the same one every time, but not always. Besides, giving it a static address makes your port forwarding rule in your router a one-time change. Then you could mod hosts to say:

Code:
# For loopbacking.
127.0.0.1		localhost
192.168.1.10		Middle-Earth.MiddleEarth Middle-Earth
Or whatever IP address you gave this machine.

What address does it have now? ifconfig
 
Old 03-08-2006, 04:17 PM   #9
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Original Poster
Rep: Reputation: 15
It's ip is 192.168.2.140, I changed it in /etc/hosts, but how do I set a static ip in linux?
 
Old 03-08-2006, 09:03 PM   #10
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Original Poster
Rep: Reputation: 15
Come to think of it, I'd rather stick with a dynamic ip (the server is the only thing plugged into the router anyway). I also fooled with changing between standalone and inetd servertypes, but they same thing happens. Is there something in post #5 that is screwing this up and if so, how do I fix it?
 
Old 03-08-2006, 10:05 PM   #11
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Original Poster
Rep: Reputation: 15
Ran a debug commmand for proftpd and got the following, is something wrong here?

Code:
root@Middle-Earth:/shares/joe# proftpd -n -d 9
 - mod_ctrls/0.9.2: binding ctrls socket to '/var/run/proftpd/proftpd.sock'
 - mod_tls/2.0.7: using OpenSSL 0.9.7g 11 Apr 2005
 - parsing '/etc/proftpd.conf' configuration
 - FS: using system open()
 - FS: using system read()
 - dispatching directive 'ServerName' to module mod_core
 - dispatching directive 'ServerType' to module mod_core
 - dispatching directive 'DefaultServer' to module mod_core
 - dispatching directive 'Port' to module mod_core
 - dispatching directive 'Umask' to module mod_core
 - dispatching directive 'MaxInstances' to module mod_core
 - dispatching directive 'User' to module mod_core
 - dispatching auth request "getpwnam" to module mod_auth_file
 - dispatching auth request "getpwnam" to module mod_auth_unix
 - dispatching directive 'Group' to module mod_core
 - dispatching auth request "getgrnam" to module mod_auth_file
 - dispatching auth request "getgrnam" to module mod_auth_unix
 - FS: using system read()
 - dispatching directive 'DefaultRoot' to module mod_auth
 - dispatching directive 'AllowOverwrite' to module mod_xfer
 - dispatching directive 'User' to module mod_core
 - dispatching auth request "getpwnam" to module mod_auth_file
 - dispatching auth request "getpwnam" to module mod_auth_unix
 - dispatching directive 'Group' to module mod_core
 - dispatching auth request "getgrnam" to module mod_auth_file
 - dispatching auth request "getgrnam" to module mod_auth_unix
 - dispatching directive 'UserAlias' to module mod_auth
 - dispatching directive 'MaxClients' to module mod_auth
 - dispatching directive 'DisplayLogin' to module mod_core
 - FS: using system read()
 - FS: using system read()
 - dispatching directive 'DisplayFirstChdir' to module mod_core
 - FS: using system read()
 - FS: using system close()
localhost -
localhost - Config for ProFTPD Default Installation:
localhost - DefaultServer
localhost - Umask
localhost - UserID
localhost - UserName
localhost - GroupID
localhost - GroupName
localhost - DefaultRoot
localhost - AllowOverwrite
localhost - UserID
localhost - UserName
localhost - GroupID
localhost - GroupName
localhost - UserAlias
localhost - MaxClients
localhost - DisplayLogin
localhost - DisplayFirstChdir
localhost - dispatching auth request "getgroups" to module mod_auth_file
localhost - dispatching auth request "getgroups" to module mod_auth_unix
localhost - SETUP PRIVS at main.c:2733
localhost - ROOT PRIVS at main.c:1967
localhost - RELINQUISH PRIVS at main.c:1974
localhost - ROOT PRIVS at main.c:2322
localhost - deleting existing scoreboard '/var/run/proftpd/proftpd.scoreboard'
localhost - opening scoreboard '/var/run/proftpd/proftpd.scoreboard'
localhost - RELINQUISH PRIVS at main.c:2348
localhost - ROOT PRIVS at mod_ctrls_admin.c:934
localhost - opening scoreboard '/var/run/proftpd/proftpd.scoreboard'
localhost - RELINQUISH PRIVS at mod_ctrls_admin.c:936
localhost - ROOT PRIVS at inet.c:322
localhost - RELINQUISH PRIVS at inet.c:362
localhost - Failed binding to 0.0.0.0, port 21: Address already in use
localhost - Check the ServerType directive to ensure you are configured correctly.
Also, here is my proftpd.conf:

Code:
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName "ProFTPD Default Installation"
ServerType standalone
DefaultServer on

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30

# Set the user and group under which the server will run.
User nobody
Group nogroup

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

# Normally, we want files to be overwriteable.

AllowOverwrite on


# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire section.

User ftp
Group ftp

# We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias anonymous ftp

# Limit the maximum number of anonymous logins
MaxClients 10

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message

Last edited by Ab3n; 03-08-2006 at 10:08 PM.
 
Old 03-09-2006, 11:33 AM   #12
Ab3n
Member
 
Registered: Sep 2004
Location: Colorado, USA
Distribution: CentOS 5
Posts: 144

Original Poster
Rep: Reputation: 15
Alright, so the problem was that I had the proftpd line uncommented in my inetd.conf and was trying to run the server as standalone.

I have a new problem though...I can access the ftp server fine on the machine itself (through ssh) but when I try to connect through smartftp or any other ftp client, it connects, logs in but then times out when trying to list the folders in the share! What would be causing this?

Last edited by Ab3n; 03-09-2006 at 12:45 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NAT Rule for FTP failing raja_lucky22 Linux - Security 2 07-04-2005 10:31 PM
FTP failing when security enabled DavidCasper Linux - Security 1 12-30-2004 04:10 PM
eth0 failing to set up axon Linux - Networking 3 10-27-2004 04:58 AM
Failing to connect to TELNET, FTP or SSH dbadft Linux - Networking 10 04-16-2003 02:44 PM
Failing to set Process ID lock when starting CommunigatePro robeb Linux - General 1 12-31-2002 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration