LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Trouble starting Proftp (https://www.linuxquestions.org/questions/linux-software-2/trouble-starting-proftp-35518/)

kaidoggy 11-15-2002 08:22 AM

Trouble starting Proftp
 
ServerType directive in the config file is set to standalone.

I attempted to start it by typing
./proftpd -n -d 5 -c /usr/local/etc/proftpd.conf

And the error message I get is
Failed binding to 0.0.0.0, port 21: Address already in use

Which I understand usually means that another process, either inetd, xinetd or another standalone ftp server, is already using the ftp port. I did have wu-ftpd running but I uninstalled it.

My problem:
How do I get port to stop being used by the xinetd process and let proftpd use it????

Thanks.

JStew 11-15-2002 09:48 AM

Run a port scan and see for sure that port 21 is in fact being used first. Although this type of mixup is rare, you never know until you start checking the obvious.

Now, I really have no idea why xinetd would even be using this port. The error message:

Failed binding to 0.0.0.0, port 21: Address already in use

Did it mean to bind this to 0.0.0.0? hopefully not as, of course, it is not a real ip address :)

kaidoggy 11-15-2002 10:31 AM

I definitely want it to use the actual IP address, but there is nowhere in the config file to set it.

morbo 12-11-2002 04:01 PM

Same trouble here, can anyone shed any light on this one?

kaidoggy 12-12-2002 07:07 AM

More of a work around than an actual fix....

In the main config file, change the port number to something other than 21, like 2021. Then in your FTP client settings it should have an option to connect via an alternate port. That's what I ended up doing and it works like a charm.

Mik 12-12-2002 09:07 AM

Why not just editing the xinetd.conf file or the ftp file in the /etc/xinetd directory and setting disable=yes

And to check whether a port is being used, checking with netstat is easier then doing a portscan.

netstat -ltp

You have to be root to be able to get the pid/program name for process the user itself doesn't own.

VincentB 04-01-2004 12:12 PM

I had the same problem.

Apr 1 19:02:25 sun proftpd[3802]: sun.xxxx.be - Failed binding to 0.0.0.0, port 21: Address already in use
Apr 1 19:02:25 sun proftpd[3802]: sun.xxxx.be - Check the ServerType directive to ensure you are configured correctly.

[root@sun xinetd.d]# netstat -tanp
Connexions Internet actives (serveurs et établies)
Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
tcp 0 0 127.0.0.1:32768 0.0.0.0:* LISTEN 3001/fam
tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2471/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2493/smbd
tcp 0 0 0.0.0.0:683 0.0.0.0:* LISTEN 1350/ypserv
tcp 0 0 0.0.0.0:685 0.0.0.0:* LISTEN 2201/rpc.mountd
tcp 0 0 0.0.0.0:654 0.0.0.0:* LISTEN 2170/rpc.rquotad
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 2384/spamd -d -c -a
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1269/portmap
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2656/httpd2
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 2475/perl
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1940/X
tcp 0 0 0.0.0.0:785 0.0.0.0:* LISTEN 1878/rpc.ypxfrd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 3973/xinetd
tcp 0 0 192.168.1.100:53 0.0.0.0:* LISTEN 1961/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1961/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1985/sshd
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 3973/xinetd
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN 2078/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2364/master
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1961/named
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 2656/httpd2
tcp 0 0 0.0.0.0:668 0.0.0.0:* LISTEN 1334/rpc.statd
tcp 0 0 0.0.0.0:7741 0.0.0.0:* LISTEN 2696/lisa


The problem was due to the fact that inetd was listening of port 21, which is precisely the port use by proftp.

Here is the content of my the proftpd.conf file:

[root@sun etc]# more /etc/proftpd.conf
# 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 inetd
DefaultServer on

# Allow FTP resuming.
# Remember to set to off if you have an incoming ftp for upload.
AllowStoreRestart 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.
<Directory />
AllowOverwrite on
</Directory>

# Needed for NIS.

PersistentPasswd off

# Default root can be used to put users in a chroot environment.
# As an example if you have a user foo and you want to put foo in /home/foo
# chroot environment you would do this:
#
# DefaultRoot /home/foo foo
Include /etc/proftpd-anonymous.conf


My problem came from Servertype which was Standalone and which should have been inetd (as I use inetd and do not run proftpd as daemon)

Finally, my proftpd-xinetd file looks like this:

[root@sun etc]# more /etc/xinetd.d/proftpd-xinetd
# default: off
# description: proftpd server, xinetd version. \
# Don't run the standalone version if you run \
# this!
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.ftpd
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
}


I have also deleted the FTP file from that directory.
Now you just have to adapt proftpd.conf file in order to grant / deny access to users.
I have spent evenings during 2 weeks trying to solve this. Hope this will also work fine for you with those indications.

Regards,
Vincent


All times are GMT -5. The time now is 06:15 AM.