VSFTPD (Very Secure FTP Daemon) is a reliable and secure FTP server that allows users to establish a secure connection to their FTP server by creating a secure tunnel that encrypts data flow. It has been available for many years and is widely used to protect files being uploaded or downloaded from hackers.
Installing VSFTPD
To enable FTP on your AlmaLinux 8 VPS, you will first need to install the VSFTPD package. You can do this by running the following command:
dnf install vsftpd -y
Once the installation is complete, start the VSFTPD service and enable it to start automatically at system boot:
systemctl start vsftpd systemctl enable vsftpd
Output:
[root@my ~]# systemctl start vsftpd
[root@my ~]# systemctl enable vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
Opening the FTP Port on the Firewall
After installing VSFTPD, you need to open the FTP port on your system firewall to allow access to the FTP service from external systems. Use the following commands to achieve this:
firewall-cmd --add-service=ftp --permanent --zone=public firewall-cmd --reload
Output:
[root@my ~]# firewall-cmd --add-service=ftp --permanent --zone=public
success
[root@my ~]# firewall-cmd --reload
success
If you encounter the following error when applying any rules from the firewalld command:
Error: COMMAND_FAILED: 'python-nftables' failed: internal:0:0-0: Error: Could not process rule: Invalid argument
You can resolve it by switching the firewall backend from nftables to iptables. Follow these steps:
- Open the firewall configuration file using the following command:
vi /etc/firewalld/firewalld.conf
- In the configuration file, locate the line
FirewallBackend=nftables
and change it toFirewallBackend=iptables
. - Save the changes and exit the text editor.
- Restart the firewalld service:
systemctl restart firewalld
Now, the firewall backend should be switched to iptables, and you should be able to reload the firewall without encountering the previous error.
Creating an FTP User
To start using VSFTPD, you need to create an FTP user and set a password for that user. Follow these steps:
- Add the user:
adduser test
- Set a password for the user:
passwd test
Output:
[root@server ~]# adduser test
[root@server ~]# passwd test
Changing password for user test.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Testing the FTP Connection
To ensure that your FTP server is working correctly, you can test the FTP connection using FileZilla or WinSCP Client software. Follow these steps:
- Input your server’s IP or hostname in the Host field.
- Enter the username of the FTP user created earlier in the Username field.
- Enter your password.
- If you have configured a different port for FTP, specify it in the Port field.
Debugging “COMMAND_FAILED” Error
If you encounter the “COMMAND_FAILED” error mentioned earlier, you can resolve it by switching the firewall backend from nftables to iptables. Follow these steps:
- Open the firewall configuration file using the following command:
vi /etc/firewalld/firewalld.conf
- Locate the line
FirewallBackend=nftables
in the configuration file and change it toFirewallBackend=iptables
. - Save the changes and exit the text editor.
- Restart the firewalld service:
systemctl restart firewalld
Now, the firewall backend should be switched to iptables, and you should be able to reload the firewall without encountering the previous error.
Conclusion
In this article, we have learned how to install and configure VSFTPD on AlmaLinux 8. By following the steps outlined, you can enable secure FTP connections and protect your files from unauthorized access. VSFTPD provides reliable and secure FTP services, ensuring end-to-end encryption between the user and the FTP server.
For more information about secure FTP services and reliable cloud hosting solutions, visit Shape.host. Shape.host offers Linux SSD VPS hosting services with efficient, scalable, and secure solutions for businesses of all sizes.