How to Install and Configure vsftpd on CentOS 7

Step 1: Install vsftpd

Consider securing your FTP connection with SSL/TLS. As a matter of best practice we’ll update our packages:

yum -y update

Then let’s install vsftpd and any required packages:

yum -y install vsftpd

Step 2: Configure vsftpd

Let’s edit the configuration file for vsftpd:

nano /etc/vsftpd/vsftpd.conf

Disallow anonymous, unidentified users to access files via FTP; change the anonymous_enable setting to NO:

anonymous_enable=NO

Allow local uses to login by changing the local_enable setting to YES:

local_enable=YES

If you want local user to be able to write to a directory, then change the write_enable setting to YES:

write_enable=YES

Local users will be ‘chroot jailed’ and they will be denied access to any other part of the server; change the chroot_local_user setting to YES:

chroot_local_user=YES

Exit and save the file.

Restart the vsftpd service:

systemctl restart vsftpd

Then set the vsftpd service to start at boot:

systemctl enable vsftpd

Step 3: Allow vsftpd Through the Firewall

Allow the default FTP port, port 21, through firewalld:

firewall-cmd --permanent --add-port=21/tcp

And reload the firewall:

firewall-cmd --reload

Last modified: September 01 2017 18:31:05