For what I can remember it has always been possible to simply do a:
apt-get install proftpd to get a working FTP server. It seems that starting with 12.04, it is not all that simple anymore. Well, it might be a bug too.
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
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:
apt-get install openbsd-inetd
/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
Then, restart inetd/xinetd:
In my setup, I have done this to setup one FTP user, aka “userftp”:
useradd userftp -d /home/FTP-shared -s /bin/false
sudo chmod 755 FTP-shared
sudo chmod 755 download
sudo chmod 777 upload
I have then saved the contents of /etc/proftpd/proftpd.conf and replaced it with my own configuration options:
# For debugging:
# I don't choose to use /etc/ftpusers file
# Allow to restart a download
# Port 21 is the standard FTP port
# Set the user and group that the server normally runs at.
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Display a message after a successful login
AccessGrantMsg "welcome !!!"
# This message is displayed for each access good or not
ServerIdent on "you're at home"
# Lock all the users in home directory