VSFTPD (Very Secure File Transfer Protocol Daemon) is an FTP server that ensures the data is secured using the FTP, moreover, the FTP server enables its users to manage their files by uploading and downloading them remotely.
The FTP is used to share files with other machines faster and more securely, moreover, the FTP is supported and popular among the UNIX distributions. In this post, the method of setting up the FTP server on Debian 12 with VSFTPD has been explained.
What is the Method to Set Up the FTP Server with VSFTPD on Debian 12?
Following the methods below, one may simply understand and set up the VSFTPD on Debian 12.
Step 1: Update the Packages
First, make sure that all the packages are up to date:
$ sudo apt upgrade -y && sudo apt update
Step 2: Install VSFTPD
After updation of all the packages, install the latest package of VSFTPD:
$ sudo apt install vsftpd -y
Verify the above command execution by displaying the version installed of VSFTPD:
$ sudo vsftpd -version
Step 3: Start, Enable, and Display the Status
After the successful installation, start the vsftpd service:
$ sudo systemctl start vsftpd
Enable the VSFTPD as well:
$ sudo systemctl enable vsftpd
When the VSFTPD is started and enabled, then display its status:
$ sudo systemctl status vsftpd
Step 4: Allow the Port 20 and 21
The VSFTPD uses port 20 and port 21 for sharing its information. Use the UFW to allow the network traffic on these ports after installing and enabling the UFW:
$ sudo ufw allow 20 && sudo ufw allow 21
To confirm the successful execution of the above command, display the status of UFW:
$ sudo ufw status
Step 5: Creation of Configuration File’s Backup
Now, we are supposed to make changes in the VSFTPD backup file. Before making any changes to it, it is recommended to create a backup of the original file:
$ sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig
Step 6: Changes in the Configuration File
Open the configuration file of the VSFTPD with the nano text editor:
$ sudo nano /etc/vsftpd.conf
Make changes according to the below-mentioned lines:
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
Save the file with the CTRL+S and then exit the nano text editor using the CTRL+X.
How Users can Manage the FTP User in Debian 12?
To use the VSFTPD, a new FTP user should be created, and restarted the VSFTPD service.
Step 1: Create the FTP User
First, create a FTP user, for example, a user “paul” is created:
$ sudo adduser paul
Step 2: Add the FTP User to FTP Users List
The FTP users list contains all the users who are allowed to access the FTP. For adding the user “paul” to that list, run the command:
$ echo "paul" | sudo tee -a /etc/vsftpd.userlist
Step 3: Restart the VSFTPD
To save the changes, restart the VSFTPD:
$ sudo systemctl restart vsftpd
How to Test the VSFTPD Server on Debian 12?
After installing and configuring the VSFTPD server on Debian 12, it’s time to test the successful working of the VSTPD. Use the below-mentioned steps to test its working.
Step 1: Install the FTP Client Server
To test the VSFTPD, an FTP client server is needed, for example, install Filezilla as the FTP Client-server:
$ sudo apt install filezilla -y
Step 2: Run the FTP Client Server
Launch the installed FTP Client Server:
$ filezilla
To find the IP address of the machine, use the command:
$ sudo ip a
Now enter the “IP address”, “Username”, “Password”, and then click on the “Quickconnect” button:
The connection will be successfully established.
Conclusion
To set up the FTP server with the VSFTPD, install it with “sudo apt install vsftpd -y” and then add the “FTP user” to the FTP user list. For testing the VSFTPD, install the FTP server client and connect to the FTP user. This blog has explained the installation, configuration, and testing of the FTP server with VSFTPD with a step-by-step guide.