Chapter #19: How to Set Up an FTP Server on Linux
Learn to install and configure an FTP server on RHEL and Ubuntu with vsftpd, including anonymous access, local logins, passive mode, and firewall setup.

In an era where massive remote storage is common, it might seem outdated to discuss sharing files using FTP (File Transfer Protocol). However, FTP remains in use for file exchange where security isn't a primary concern and for public downloads of documents.
For instance, it's still relevant to learn how to configure an FTP server and enable anonymous downloads (no authentication required).
In this chapter, we'll explain how to set up an FTP server to allow passive mode connections, where the client initiates both communication channels to the server (one for commands and the other for actual file transmission, known as the control and data channels, respectively).
You can read more about passive and active modes (which we won't cover here) in "Active FTP vs. Passive FTP: A Definitive Explanation".
That said, let's begin!
Setting Up an FTP Server
To set up FTP on our server, we'll install the following packages depending on our current distribution:
sudo dnf install vsftpd ftp # RHEL
sudo apt install vsftpd ftp # Ubuntu
The vsftpd
package is an implementation of an FTP server. The name stands for Very Secure FTP Daemon. The ftp
package is the client program used to access the server.
Keep in mind that during the exam, you'll be provided with a single VPS where you'll need to install both the client and server. This is the approach we'll follow in this chapter.
On RHEL, you'll need to start and enable the service:
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
On Ubuntu, vsftpd
should start automatically after installation. If not, you can start it manually with:
sudo systemctl start vsftpd
Once vsftpd
is installed and running, we can proceed to configure our FTP server.
Configuring the FTP Server
At any point, you can refer to man vsftpd.conf
for further configuration options. We'll set the most common options and explain their purpose in this guide.
As with any configuration file, it's important to back up the original before making changes:
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.orig
Then, open /etc/vsftpd/vsftpd.conf
(the main configuration file) and edit the following options as indicated:
1. Enable Anonymous Access
Make sure you allow anonymous access to the server (we will use the /storage/ftp
directory for this example - thatβs where we will store documents for anonymous users to access) without password: