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:

[root@testvm ~]# yum -y update
[root@testvm ~]# yum -y install vsftpd

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

[root@testvm ~]# 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:

[root@testvm ~]# systemctl restart vsftpd
[root@testvm ~]# systemctl enable vsftpd

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

[root@testvm ~]# firewall-cmd --permanent --add-port=21/tcp
[root@testvm ~]# firewall-cmd --permanent --zone=public --add-port=10090-10100/tcp
[root@testvm ~]# firewall-cmd --reload