LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to set up ftp... and failing (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-set-up-ftp-and-failing-422589/)

Ab3n 03-07-2006 03:53 PM

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?

Dragineez 03-07-2006 04:00 PM

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.

Ab3n 03-07-2006 04:03 PM

So how would I go about fixing that? My router is set up to forward the correct ports...

Dragineez 03-07-2006 04:22 PM

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.

Ab3n 03-07-2006 04:26 PM

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?

Dragineez 03-08-2006 09:36 AM

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?

Ab3n 03-08-2006 12:27 PM

/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...

Dragineez 03-08-2006 01:10 PM

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

Ab3n 03-08-2006 04:17 PM

It's ip is 192.168.2.140, I changed it in /etc/hosts, but how do I set a static ip in linux?

Ab3n 03-08-2006 09:03 PM

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?

Ab3n 03-08-2006 10:05 PM

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


Ab3n 03-09-2006 11:33 AM

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?


All times are GMT -5. The time now is 05:26 AM.