1. How to install an FTP server on CentOS 7.
2. Configure FTP Server
3. Jail FTP user
4. Allow FTP through a firewall
FTP (File Transfer Protocol) server used to upload or download the files between server end to the client end. By default, FTP is insecure because it sends credentials without encryption.
In this tutorial, I will guide you to install, configure and secure a FTP server on CentOS 7.
1.Install Required Package:
[arun@localhost ~]$ yum install vsftpd
2. Configure FTP server
Next step is to configure the FTP server. For this, first we will take backup of original configuration by cp command.
[arun@localhost ~]$ sudo cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.original
3. Open the configuration file and need to make some changes as done below:
[arun@localhost ~]$ sudo vi /etc/vsftpd/vsftpd.conf
1. A file is opened, firstly disable the anonymous FTP because it allows unidentified users to access the files over FTP. By default, it allows anonymous FTP.
2. Now, set local_enable to YES. This will allow local created normal user to function as FTP account. By default, it is YES.
3. Next step is to allow local user to write on a directory. By default it is YES.
4. Jail user in home directory : As the security concern, we do not allow FTP user to access any other directory of the server except FTP directory.Set chroot jailed to YES.
5. Settings has been modified, need to restart the vsftpd service and also set it enable on boot.
[arun@localhost vsftpd]$ systemctl restart vsftpd
Enable on boot:
[arun@localhost vsftpd]$ systemctl enable vsftpd
6. Next step is to allow FTP server by firewall rules:
[arun@localhost vsftpd]$ firewall-cmd --permanent --add-port=21/tcp
7. Final step is to reload the firewall settings:
[arun@localhost vsftpd]$ firewall-cmd --reload
Now, browse the FTP server by visiting the ftp://server-ip-address
Public FTP Home Directory: /var/ftp
Congratulations !! You have learned how to install and configure FTP server. For any feedback, kindly write in below comment box.