Vsftpd (Very Secure FTP Daemon), licensed under GNU General Public License, is an FTP protocol used to transfer files to and from a remote network. It is a secure, stable, and fast FTP server that is supported on Linux/UNIX operating systems. In this post, we will learn how to set up a vsftpd FTP server on the Debian system.

Note: The commands have been tested on the latest release of Debian i.e., Debian 10.

Setup vsftpd FTP Server on Debian 10

Follow the below steps in order to setup vsftpd server on Debian 10:

Step 1: Install VSFTPD

First, update the repository index using the below command in Terminal:

Now, you can install vsftpd as follows:

$ sudo apt install vsftpd

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/1-1.png600a3005a6b81.jpg" data-lazy- height="220" src="data:image/svg xml,” width=”824″>

The system might prompt you for a sudo password and might also prompt you with the Y/n (yes/no) option for proceeding with the installation of vsftpd. Press Y to proceed.

After the installation is finished, you can verify it using the below command:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/2.png600a30062441a.jpg" data-lazy- height="61" src="data:image/svg xml,” width=”425″>

Step 2: Allow FTP in the firewall

If a firewall is running on your machine, allow ports 20 and 21 for FTP traffic. To check if a firewall is running, run the below command in Terminal:

If you see “active” status in the output, it means the Firewall is running on your system.

Now to allow port 20 and 21, run the below command in Terminal:

$ sudo ufw allow 20/tcp


$ sudo ufw allow 21/tcp

Now to confirm if the rules have been added, run the below command in Terminal:

The below output shows the Firewall has allowed the FTP ports.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/3.png600a3006b13a7.jpg" data-lazy- height="213" src="data:image/svg xml,” width=”536″>

Step 3: Configuring FTP Access

Now we will do some basic configurations for the FTP server. But before going for configurations, let’s make a backup of the vsftpd configuration file using the below command in Terminal:

$ sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig

Now edit the vsftpd configuration file as follows:

$ sudo nano /etc/vsftpd.conf

Now modify the configurations to match them as follows:

listen=YES

listen_ipv6=NO

connect_from_port_20=YES

anonymous_enable=NO

local_enable=YES

write_enable=YES

chroot_local_user=YES

allow_writeable_chroot=YES

secure_chroot_dir=/var/run/vsftpd/empty

pam_service_name=vsftpd

pasv_enable=YES

pasv_min_port=40000

pasv_max_port=45000

userlist_enable=YES

userlist_file=/etc/vsftpd.userlist

userlist_deny=NO

Now save and close the vsftpd.conf configuration file.

Step 4: Add FTP user

Now, we will add a user to the allowed FTP users list. For testing purposes, we will create a new user account named “tin”, and then set its password.

To create a new FTP user, use the following command:

Then set its password using the command below:

Add the user to the allowed FTP users list:

$ echo “tin” | sudo tee -a /etc/vsftpd.userlist

Step 5: Restart VSFTPD service

Once you have finished the configurations, restart the vsftpd service. Run the command below to do so:

$ sudo systemctl restart vsftpd

To enable the vsftpd as a startup, run the following command in the Terminal:

$ sudo systemctl enable vsftpd

Step 6: Test FTP Access

We have configured the FTP server to allow access to only user “tin”. Now to test it, you will need an FTP client. We will use here the Filezilla as the FTP client.

You can install the Filezilla as follows:

$ sudo apt install filezilla

To launch Filezilla, either search it through the Applications list or simply execute the following command in Terminal:

This will be the default view you will see when you launch the Filezilla.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/4.png600a30076315c.jpg" data-lazy- height="473" src="data:image/svg xml,” width=”985″>

Now to connect to the FTP server, we will require its IP address. You can find the IP address of your FTP server by entering the command in Terminal:

The below output shows the IP address of our FTP server is 192.168.72.189.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/5.png600a300815d16.jpg" data-lazy- height="289" src="data:image/svg xml,” width=”1111″>

In the Filezilla window, type the IP address of the vsftpd FTP server, username, and password in their respective fields. Then, click Quick connect to connect to the vsftpd FTP server.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/6.png600a3008bc07c.jpg" data-lazy- height="729" src="data:image/svg xml,” width=”923″>

Once you are connected to the FTP server, try uploading and downloading the files to and from the FTP server, respectively.

Conclusion

That is all there is to it! In this post, we have covered how to setup vsftpd FTP server on Debian 10 machine. Now, you can easily access and upload/download files to and from your FTP server, respectively.

About the author

<img alt="Karim Buzdar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/karim-150×150.png600a300939683.jpg" height="112" src="data:image/svg xml,” width=”112″>

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.