Howto: Set up FTP on CentOS 6 – VSFTPD
In this how to we’re going to setup an FTP server on our CentOS machine. Now, before we begin, a word of warning. FTP is inherently insecure and may cause your server to become vulnerable to attack. Consider using FTP with SSL, or SFTP, FTP over SSH. Follow this tutorial at your own risk.
Install the package
Use the following command to grab the vsftp package from the repos and install it.
sudo yum install vsftpd
By default, vsftp comes reasonably securely configured. That being said, it does allow anonymous logins, which are useful if you want to distribute files openly, but not if want security. We’re going to disable that. We’re also going to restricted users to their own home directories, so that if one user account is compromised, a hacker shouldn’t be able to access the whole server.
To do this, we’re going to edit the configuration file using:
sudo vim /etc/vsftpd/vsftpd.conf
Within this file, change the following settings to the values below.
anonymous_enable=NO local_enable=YES chroot_local_user=YES
This will prevent anonymous logins, and restrict users to their own files and directories.
Finally, let’s restart the server.
sudo service vsftpd restart
To ensure it runs at boot up, we’ll need to use chkconfig
chkconfig vsftpd on
That’s it! You should now be able to login to the FTP server using an application such as FileZilla or even through a web browser, by entering
and loging in with valid credentials.
Filed under: CentOS, HowTo |
Tags: CentOS, FTP, VPS