Vsftpd, short for Very Secure FTP Daemon, is a popular FTP server known for its security and performance. Here's a step-by-step guide to installing and configuring Vsftpd on CentOS.
Installation:
Install Vsftpd using the dnf package manager.
[root@www ~]# dnf -y install vsftpd
Configuration:
Edit the Vsftpd configuration file to set up the server.
[root@www ~]# vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
chroot_local_user=YES
chroot_list_enable=YES
allow_writeable_chroot=YES
chroot_list_file=/etc/vsftpd/chroot_list
ls_recurse_enable=YES
listen=YES
listen_ipv6=NO
local_root=public_html
use_localtime=YES
Chroot List:
Define users who are allowed to move beyond their home directory in the chroot_list.
[root@www ~]# vi /etc/vsftpd/chroot_list
Add users to the file:
cent
Enable and Start Vsftpd:
Enable and start the Vsftpd service.
[root@www ~]# systemctl enable --now vsftpd
SELinux Configuration:
If SELinux is enabled, adjust the boolean setting for full FTP access.
[root@www ~]# setsebool -P ftpd_full_access on
Configure Firewall:
Allow FTP service ports in Firewalld.
[root@www ~]# firewall-cmd --add-service=ftp
[root@www ~]# firewall-cmd --runtime-to-permanent
After completing these steps, Vsftpd should be properly installed and configured on your CentOS system. This setup ensures a secure FTP server environment with chrooted user directories and disabled anonymous access. Remember to regularly check for updates and apply necessary security patches to keep your FTP server secure.