In this article, we will learn how to configure FTP server on CentOs 7 using vsftpd. vsftpd (Very Secure File Transport Protocol Daemon) is a secure and very fast FTP server on Linux systems.
Install vsftpd
All commands should be run with root user. Run the following command in terminal to install vsftpd package:
Configure vsftpd
We needed to edit the configuration file /etc/vsftpd/vsftpd.conf for securing the FTP server since, by default it will allow anonymous users to login and use the server.
We have to disallow anonymous, unidentified users to access files via FTP; change the anonymous_enable setting to NO:
Allow local users to login by changing the local_enable setting to YES:
If you want to allow the local users to be able to write to a directory, then change the write_enable setting in the configuration file to YES:
Local users will be ‘chroot jailed’ and they will be denied access the local users to any other part of the server; change the chroot_local_user setting in the configuration file to YES:
Below is the simple configuration file for your reference:
Enable and restart the vsftpd service
We needed to restart the vsftpd services so that the configuration changes has applied.
We will set the vsftpd service to start at boot time, below is the command to enable the vsftpd to start.
Allowing the vsftpd Through the Firewall
Allow the ftp service and port 21 via firewall.
Restart firewall:
Create FTP users
By default, root user is not allowed to login to ftp server for security purpose. So, let us create a normal testing user called “ftpuser” with password “centos”.
Connecting to FTP server
Now, try to connect to FTP server itself with user “ftpuser”:
Enter the ftp user name and password.
Note: change 192.168.3.157 with your own FTP server address.
Sample Output:
Congratulations! you will be able to login to FTP server without any problems.
Reference
[1]: http://www.tutorialspoint.com/articles/how-to-install-and-configuration-ftp-server-in-centos-7
[2]: https://www.unixmen.com/install-configure-ftp-server-centos-7/