VSFTPD is an FTP server for Unix/Linux systems. It is a default FTP server on CentOS, RHEL Linux distributions, and other Linux OS. It also supports IPv6, TLS, and FTPS. Please refer to the following steps to install VSFTPD on Centos 7.x.
- Log in to your Linux server with root or sudo user using SSH.
- Let us run the update before we proceed for the installation.
yum -y update
- Install the VSFTPD with the below command.
yum -y install vsftpd
- We will edit the VSFTPD setup to configure it. Open the vsftpd.conf located at /etc/vsftpd/ directory. You can use your favorite editor for this.
- Disable the anonymous logins. This will prevent unidentified users from accessing files via FTP. Set the anonymous_enable to NO:
- Allow the login for the local users. It enables your local user accounts to function as FTP accounts. Set local_enable to YES:
- If you want to allow your local user to be able to write to a directory, set the write_enable to YES:
- We need to set chroot_local_user to yes. This option will deny your local users access to the other part of the server. Set the chroot_local_user to YES:
- Save all the changes and exit from the file.
- Now, we will enable and restart the VSFTP service.
systemctl enable vsftpd
systemctl restart vsftpd
You need to allow port 21 for VSFTP in the Linux firewall. Please refer to how to allow a port in a Linux firewall?
- Now we will create a user account and configure it to connect with FTP.
- Add a user with the below command.
- Set the password for the created user with the below command.
- Add the user to the VSFTP user list.
echo “demovps” | sudo tee –a /etc/vsftpd/user_list
- Let us set the proper permission for the user folder.
sudo chmod 750 /home/demovps/
sudo chown -R demovps: /home/demovps/