Proftpd is a remarkably versatile Unix/Linux FTP server daemon that has been in under active maintenance for more than 20 years. Downloading the base package from a stable Linux repository or performing a default installation from the latest source will net you a solid and easy to use server.
But what if you want more that just a default installation? There are hundreds of configurable options and more than a few dozen contributed or 3rd party modules, each with their own quirks/caveats that can lead a mostly Windows person down a thousand rabbit holes if you aren’t careful or have a strong background in Linux administration. In addition, while the base install of ProFTPd / OpenSSL from a stable repository will work “out of the box”, there’s a good chance that you won’t have the latest version of ProFTPd and OpenSSL (or source) due to delays from extensive vetting by Canonical.
This multi-part tutorial is my re-cap of months of monkeying around with Proftpd, following hundreds of different links, reading pages and pages of info, finally getting it to work they way I want it to.
Please link back to these instructions so others may find them on Google. (You know how it works — only pages with the highest number of incoming links get the best search position. If this guide helped you, help others find it too.)
- You are a Windows professional or advanced user who “tinkers” with Linux as a hobby or as a non-critical part of your job. Expert Linux isn’t required, but you should understand basic commands like cat, tail, ls, grep, etc. You need to know how to use “vi” or some other command line text editor.
- You have a [mostly] vanilla installation of ubuntu 10.04.04 LTS server that has been fully updated with all security patches and application updates. It’s entirely probable newer versions of Ubuntu will work fine (12.04 as of this writing) but this guide has only been tested with 10.04. The SSH server daemon needs to be installed either manually or as a part of an initial server load.
- I make use of the Webmin utility to handle several basic Linux administrative tasks. As I mentioned, the audience for this guide is a mostly Windows person who tinkers. You’re not here to learn how to create new user accounts from a command line.
We’ll be compiling, installing, and configuring ProFTPd to use a non-standard port number, SSL, behind a firewall, and on a non-routable IP block.
Let’s get started…
In order to “roll our own” version, we need to get some development utilities from both stable Canonical and unsupported Debian repositories. Don’t worry, we’ll uninstall these utilities when we’re finished to reduce the server footprint and enhance security.
- SSH into your Ubuntu server.
- Install compiler and dependencies
sudo apt-get install build-essential
- Edit apt repository source URLs, change local cache size, and update. (needed for additional packages to get a clean compile of proftpd with external OpenSSL source)
- Edit repository sources
sudo vi /etc/apt/sources.list
- add this line somewhere, save and close
deb http://http.us.debian.org/debian squeeze main
- Open repository config file
sudo vi /etc/apt/apt.conf.d/70debconf
- Add this line somewhere, save and close
- Update your package cache
sudo apt-get update
sudo apt-get update --fix-missingThe second command above will likely generate the following error:
W: GPG error: http://http.us.debian.org squeeze Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
Ignore it! From the accepted answer:
- Edit repository sources
If you are not extremely paranoid, or in a high security environment, then just let apt-get install debian-archive-keyring install, and ignore the warning.
- install additional support packages (fixes a compile issue. reference 1, reference 2.)
sudo apt-get install zlib1g zlib1g-devNote
If you happen to run sudo aptitude after the steps above, you’ll see that your system is outdated by several hundred package updates. Ignore these. As soon as you uninstall the development utilities, remove the Debian repository URI, and update aptitude, your system will return to fully updated status (assuming it was before you started)
Download, Compile, and Install OpenSSL
- Create some directories we’ll need for the latest version of OpenSSL. You may chose to download the tarball to the “src” directory if you wish. Personally, I save full, unmodified, zipped src if I need to completely redo a compile or installation in the future.
sudo mkdir /etc/openssl
sudo mkdir /etc/openssl/install
sudo mkdir /etc/openssl/src
- Change directories to “install”
- Download latest version of OpenSSL source code
sudo wget -c http://openssl.org/source/openssl-1.0.1c.tar.gzLatest version can be found at http://openssl.org/source/ and is usually marked red. Copy the URL of the tar file to your clipboard and paste it into your SSH command. NOTE: This guide was written using the version of OpenSSL noted. YMMV for other versions.
- Copy the tar file to our src directory
sudo cp ./openssl-1.0.1c.tar.gz ../src/
- change directories to “src”
- Unzip the package
sudo tar zxvf ./openssl-1.0.1c.tar.gz
- Delete the tar file
sudo rm -f ./openssl-1.0.1c.tar.gz
- Change directories to where the unzipped source is
- Configure the source for compile. There are extra switches you can use for this command, but I’m not going to cover them or promise they are compatible with later steps in this guide. If you want to know what the switches below are for, Google it. reference
sudo ./config no-threads -fPIC
- Compile the source code to an installer
sudo make cleanto reset the configuration back to default… helpful for trying different configuration options)
- Test the installer
sudo make test
- Install OpenSSL
sudo make install
OpenSSL and source is now installed.