Welcome to Linux Tutorial. FTP is a popular way of transferring files to a server. If you are planning to build your own FTP Server, there are many of tutorials on the net that can help you out. Today, we are going to install or build an FTP Server on top of our CentOS 7 server. We will use vsftpd package that provides a powerful FTP server capability. There are several requirements to install FTP Server on CentOS 7. In this example, I am running my CentOS 7.3 Server on Linode Cloud Computing. It’s a great way to start the cloud computing for your own.
Steps to install FTP Server on CentOS 7.3 Server
First, make sure you have root access to the server. You may connect to the server via SSH connection.
Step 1. Install vsftpd
The following command will update your CentOS repository and then install vsftpd.
su yum update yum install vsftpd
Step 2. Configure vsftpd
In order to ensure that our ftp server runs well, we need to make some changes. Open vsftpd.conf and we need to edit some lines in it.
nano /etc/vsftpd/vsftpd.conf
Disable Anonymous access
We highly recommend to disable anonymous access to the FTP Server. To do this, find and change the following lines.
anonymous_enable=NO
Allow local users to use their login credential to the FTP Server. To do this, make sure you change the local_enable setting to YES.
local_enable=YES
Now, we can allow local users to write to the FTP directory. To do this, make sure you change write_enable setting to YES
write_enable=YES
Local users will be ‘chroot jailed’ and they won’t be able to access any other part of the server. To do this, change the chroot_local_user setting to YES
chroot_local_user=YES
Now close and save the vsftpd.conf file.
Restart vsftpd service
systemctl restart vsftpd
Now enable the service so it will be loaded during system boot.
systemctl enable vsftpd
Step 3. Configure the firewall
By default, firewall will block the FTP connection. We need to allow the FTP through the firewall
firewall-cmd --permanent --add-port=21/tcp firewall-cmd --reload
Step 4. Test the connection
Now we need to test the FTP Server. I use Filezilla client to connect to our FTP Server. You may download Filezilla from this link.
Make sure you can connect using CentOS users and password. Thanks for reading this post and consider share this article using the link below.
Leave a Reply