Home » Posts tagged "xinetd"

Getting ProFTPD to work on Ubuntu 12.04

For what I can remember it has always been possible (at least) since Ubuntu 7.04 to simply do a sudo apt-get install proftpd to get a working FTP server running. It seems that starting with Ubuntu 12.04 no more!

After installing proftpd on 12.04 (the package is now called proftpd-basic) you’ll be unable to start the service. I’ve tried it both as standalone and using inetd but neither would work. ProFTPD, or rather its init.d script will report ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration. Yes, that helps a lot.

Looking at the syslog I found the following message when trying to connect to the FTP server: error: cannot execute /usr/sbin/in.ftpd: No such file or directory. It turns out that this path is defined in /etc/inetd.conf and for Ubuntu 12.04 it appears that the proftpd-basic package doesn’t install these. If you don’t have the FTP service defined in inetd/xinetd it simply rejects any connection, giving less helpful error messages.

So the fix to this problem is rather easy. If the file doesn’t exist yet create /etc/inetd.conf (regardless if you use inetd or xinetd). Then, simply add the following line, or replace the existing one with the following:

ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  /usr/sbin/proftpd

Now restart the service: sudo service inetd restart or sudo service xinetd restart.

So the only change you really need to make is change the path to the FTP server. This fix works for both inetd and xinetd. For a proper solution for xinetd please see the section below.

Proper xinetd fix

I reckon that the creators of xinetd decided to support inetd compatibility by supporting the /etc/inetd.conf file. If you want to configure xinetd the proper way you can create a config file for it in /etc/xinetd.d/ftp and stick the following lines in it:

service ftp
{
      disable = no
      flags                   = REUSE
      socket_type             = stream
      wait                    = no
      user                    = root
      server                  = /usr/sbin/proftpd
      server_args             = -c /etc/proftpd/proftpd.conf
}
  • socket_type: Sets the network socket type to stream.
  • protocol: Sets the protocol type to TCP
  • wait: You can set the value to yes or no only. It Defines whether the service is single-threaded (if set to yes) or multi-threaded (if set to no).
  • user: User who will run proftpd

And finally restart the service: sudo service xinetd restart.

(Source for setting up a service for xinetd).