FTP, short for File Transfer Protocol, is a protocol that provides access to files residing on a server. It’s one of the earliest protocols that enabled users to download files over the internet. With the FTP protocol, users can download and upload files on servers with ease.
Vsftpd, short for Very Secure FTP daemon, is a secure FTP daemon that is an upgrade of FTP protocol. It enforces secure connections to FTP servers by encrypting traffic send to and from the server, and by so doing, the file transfer is kept safe and secure from hackers.
In this topic, we shine the spotlight on the installation of vsftpd on CentOS 8 / RHEL 8.
Step 1) Install vsftpd using dnf command
Right off the bat, we are going to install vsftpd. To achieve this, we will run the command below:
$ sudo dnf install vsftpd
Press ‘y’ and hit ENTER to get underway with the installation. The installation takes a few seconds and will complete in no time. The output below confirms that vsftpd has been successfully installed.
The output indicates that we have installed vsftpd version 3.0.3-31.el8.x86_64. To confirm this, execute the following command:
[[email protected] ~]$ rpm -q vsftpd vsftpd-3.0.3-31.el8.x86_64 [[email protected] ~]$
The output should tally with the version printed on the terminal upon successful installation. To retrieve more detailed information about Vsftpd, append the -i flag at the end as shown:
$ rpm -qi vsftpd
This will print additional information on the screen such as the Architecture, install date, license and signature to mention a few.
With vsftpd installed, we need it running to facilitate access to file shares.
To start the vsftpd service, run the command:
$ sudo systemctl start vsftpd
You may also want to enable it to start automatically upon a reboot. To achieve this, run the command
$ sudo systemctl enable vsftpd --now
To verify the status of vsftpd on your system, run:
$ sudo systemctl status vsftpd
If you see the “active: (running)” directive in green as indicated on the terminal, then the vsftpd service is up and running.
Step 2) Create a ftp user and its directory
Next, we will create a user that we will use to access the FTP server. In this case, the user will be ftpuser but feel free to give your user a name of your choice.
$ sudo adduser ftpuser $ sudo passwd ftpuser
With the FTP user in place, we will proceed and create the FTP directory and assign the following permissions and directory ownership.
$ sudo mkdir -p /home/ftpuser/ftp_dir $ sudo chmod -R 750 /home/ftpuser/ftp_dir $ sudo chown -R ftpuser: /home/ftpuser/ftp_dir
We also need to add the FTP user to the /etc/vsftpd/user_list file to allow the user access to the vsftp server.
$ sudo bash -c 'echo ftpuser >> /etc/vsftpd/user_list'
Step 3) Configure vsftpd via its configuration file
So far, we have managed to install and confirm that vsftpd is up and running. Further adjustments are necessary for Vsftpd to allow users access to the server.
The default configuration file for vsftpd is the /etc/vsftpd/vsftpd.conf file. The file is replete with directives that help fortify your FTP server’s security.
In this section, we will make …