How to setup and configure FTP on a CentOS server
FTP is still widely used and although insecure it’s invaluable to servers. From uploading your documents to files to changing the permissions of directories it’s likely one of the most popular programs installed on workstations. Here we’re going to deploy FTP to a CentOS 6.7 VPS server and configure it so we jail users in their own directories upon login. You will need root access to complete this and will be the same on CentOS dedicated servers.
Once your logged in as room first let’s install nano to edit the configuration files and update the system so you have the latest security patches and updates working on reboot
Step One – Updating & Installing VSFTPD
yum install nano -y ; yum update -y
Once that has been completed you can proceed to deploy an FTP server and daemon. We’re going to use vsftpd
yum install vsftpd -y ; yum install ftp -y
Once you have this deployed to your VPS server or dedicated server, for the most part, the software is installed but there are still some changes you should make in the configuration file.
Step Two— Configure FTP
We already installed nano before to edit files so let’s now open up the configuration file of vsftpd to make some additional edits for security. You should configure FTP to your exact needs. Avoid allowing anonymous users
We’re going to list the main points that we think should be done at a bare minimum in this file. Each user will have possibly different needs from the software and therefore require different settings.
At the moment anyone can connect to this server and login. This is useful if you are looking to distribute files to the world but other than that is counted as a security risk. We advise this setting to be offanonymous_enable=NO
To keep users who have logged in, inside there own user directory it’s important to chroot the users. Uncomment the linelocal_enable=YES
Those are the two most common issues you should now finish the setup by restarting the FTP server
service vsftpd restart
And finally to make sure FTP restarts if the dedicated server or VPS server reboots, issue the following command
chkconfig vsftpd on
Step Three — Create an account & Connect to your FTP server
To create an account to connect to the server issue the below command replacing first2host with the username you wish to use
Now let’s create a password for that user, remember to replace first2host with the username you just created
Now using a program like Filezilla in the hostname place the servers IP in the username place the username you created and in the password field place the password for the user and then connect. You should then see the accounts directory listing. FTP is now installed.
How was this article? – How to setup and configure ftp on a CentOS server
More from Dedicated Servers
Enable Mod_RemoteIP – See Visitors Real IP address when using Cloudflare & Apache
If you are using Cloudflare on your Apache server you will always see Cloudflare IPs in your logs and not …
Fix 413 Request Entity Too Large Errors When Using NGINX
Just like Apache, NGINX imposes default limits on the size of files that can be uploaded. A 413 Request Entity …
Cloud-init Modules That Automate and Customize Deployments
Cloud-init is a popular way to automate deployments of instances in a cloud or none cloud environment. To save having …