How to setup vsftpd on CentOS 7

To have your own ftp server running on your VPS – you can use either proftpd or vsftpd servers. In this howto we’ll setup and configure vsftpd for basic needs. To begin we have to install the package:

[[email protected] ~]# yum -y update
[[email protected] ~]# yum -y install vsftpd

Now make sure that you enable these options in /etc/vsftpd/vsftpd.conf:

[[email protected] ~]# vim /etc/vsftpd/vsftpd.conf

Options to enable:

Disallow anonymous users to access FTP:

anonymous_enable=NO

Allow local uses to login:

local_enable=YES

Allow users to write to their directories:

write_enable=YES

Lock users in their home directories, disallowing them to browse outside their directories:

chroot_local_user=YES

Save the file and exit from vim by typing:

:wq

Now let’s restart the vsftpd service to get new settings and enable it to run on startup:

[[email protected] ~]# systemctl restart vsftpd
[[email protected] ~]# systemctl enable vsftpd

If you have ftp enabled by default – open the port on it:

[[email protected] ~]# firewall-cmd --permanent --add-port=21/tcp
[[email protected] ~]# firewall-cmd --permanent --zone=public --add-port=10090-10100/tcp
[[email protected] ~]# firewall-cmd --reload