Introduction:
ProFTPD (Pro FTP Daemon) is a powerful and flexible FTP server widely used on Linux-based systems. It is known for its ease of configuration, extensive features, and strong security capabilities. This article provides a step-by-step guide to installing and configuring ProFTPD on an Ubuntu 18.04 server.
Prerequisites:
Before starting the installation, ensure that the following requirements are met:
- A server running Ubuntu 18.04
- Root privileges or a user with
sudo
access - Basic familiarity with the Linux command line
Step 1: Update the System
It’s essential to update your system’s package list and installed packages before installing any new software. Run the following commands to ensure everything is up to date:
sudo apt update
sudo apt upgrade
Step 2: Install ProFTPD
Once your system is up to date, you can proceed with installing ProFTPD. Ubuntu’s default repositories contain the ProFTPD package, so you can easily install it using the apt
package manager.
Run the following command to install ProFTPD:
sudo apt install proftpd
During installation, you will be prompted to choose whether ProFTPD should run as a Standalone service or via inetd. For most use cases, select Standalone since it allows ProFTPD to manage its own processes independently of other services.
Step 3: Configure ProFTPD
ProFTPD’s primary configuration file is located at /etc/proftpd/proftpd.conf
. You can edit this file to adjust settings and customize the FTP server according to your needs.
3.1 Open the Configuration File
You can edit the ProFTPD configuration file using any text editor, such as nano
:
sudo nano /etc/proftpd/proftpd.conf
3.2 Basic Configuration Settings
Below are some key configuration options that you may want to modify:
- ServerName: Change the FTP server’s name to something more descriptive:
ServerName "My FTP Server"
- Default Root Directory: Restrict users to their home directories after logging in. This ensures that users only have access to their own files:
DefaultRoot ~
- User and Group Management: If you want to allow users to access the FTP server even if they don’t have a shell account, you can disable the requirement for a valid shell:
RequireValidShell off
- Anonymous FTP Access (Optional): If you wish to allow anonymous users to access a public directory, you can enable anonymous access by adding the following block:
<Anonymous ~ftp>
User ftp
Group nogroup
UserAlias anonymous ftp
MaxClients 10
<Directory *>
<Limit WRITE>
DenyAll
</Limit>
</Directory>
</Anonymous>
Step 4: Start and Enable ProFTPD
After editing the configuration file, you can start the ProFTPD service and ensure that it runs automatically when the server boots:
sudo systemctl start proftpd
sudo systemctl enable proftpd
To confirm that the service is running, you can check its status with the following command:
sudo systemctl status proftpd
You should see an output indicating that the service is active and running.
Step 5: Configure the Firewall
If you have a firewall enabled on your server (such as ufw
), you need to allow FTP traffic through port 21, which is the default port used by FTP. Use the following command to open port 21 for incoming FTP connections:
sudo ufw allow 21/tcp
sudo ufw reload
If you’re using passive mode FTP, you’ll also need to configure and allow the passive ports you’ve defined in ProFTPD’s configuration.
Step 6: Test the FTP Server
Once the installation and configuration are complete, it’s time to test the FTP server. You can do this by connecting to your server using an FTP client like FileZilla or the ftp
command from another machine.
To test using the command line, type:
ftp <server-ip-address>
Enter your username and password when prompted. If you set up anonymous access, you can log in with the username anonymous
.
Step 7 (Optional): Secure the FTP Server with SSL/TLS
To secure your FTP connections, you can enable SSL/TLS, ensuring that your data is encrypted while being transferred. First, you’ll need to install the proftpd-mod-crypto
package:
sudo apt install proftpd-mod-crypto
Next, edit the ProFTPD configuration to enable TLS by adding the following lines:
<IfModule mod_tls.c>
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv23
TLSRSACertificateFile /etc/ssl/certs/proftpd.crt
TLSRSACertificateKeyFile /etc/ssl/private/proftpd.key
TLSOptions NoCertRequest
TLSVerifyClient off
TLSRequired on
</IfModule>
Be sure to replace the paths to the certificate and key files with your own SSL certificate files. You can use a self-signed certificate or obtain a free SSL certificate from Let’s Encrypt.
Conclusion:
In this guide, we have walked through the process of installing and configuring ProFTPD on an Ubuntu 18.04 server. After following these steps, you will have a functioning FTP server that you can use to upload and download files. You can further customize your FTP server based on your requirements and implement additional security features like SSL/TLS for encrypted connections.