Recommended VPS Complete list of best VPS hosting providers.

How To Install and Setting Up vsftpd on CentOS Server

How to install Very Secure FTP on your CentOS server. Looking for the way how to upload, download, edit, manage and organize all your website’s files stored remotely in your CentOS server? Using FTP is the perfect choice because the server we are talking about here is the one with no cPanel or any other control panel software so you don’t have access to those files and folders via web-based File Manager. In this page, I’ll tell you how to install vsftpd, a very secure FTP software so you’ll have access to your server via FTP with strongest protection available. At least the FTP connection is protected against most common or basic FTP vulnerabilities.

Once installed and setup, you’ll also need a client app that supports SFTP connection and for me, the most important one it should be a freeware. Need recommendation? Try FileZilla, CoreFTP, WinSCP, and CoffeeCup Free FTP. However you can simply access your server via FTP through a web browser but for download-only purpose, not for uploading.

How to Install VSFTPD

Step 1 – Login to your server and follow my previous guide about Basic setup for CentOS before you build a live web server. You may and may not follow that tutorial but if you followed, it will give you some basic security tweak to your server.

Before you proceed to the next steps, it is better to explain that all commands in this tutorial are written without the “sudo” prefix. However if you disabled root login and you logged in using another username with root privilege, you can add the “sudo” prefix all by your self. Alternatively you can simply type su, hit Enter and type in your password twice to switch login as root.

switch-root-login

You may also need to type this command to go to the root directory:

cd ~

Step 2 – Now issue this command syntax to install vsftpd:

yum install vsftpd

You may also need to confirm the install by answering Y.

yum install vsftpd

Once done you’ll see the “Complete!” message.

Step 3 – Next, also install free ftp client software on your server by issuing this command:

yum install ftp

Again, hit Y if asked to confirm.

install ftp

Step 4 – That’s it. Basically you’ve installed all necessary ftp software on your server. But you may also need to setup several configuration following the next section.

How To Setup VSFTPD Configuration

Step 1 – First thing first, open “vsftpd.conf” file, the file that holds all vsftpd configuration. In this tutorial I’ll use Nano editor.

nano /etc/vsftpd/vsftpd.conf

Step 2 – Disable ftp anonymous login. To do that, find the line below and make sure its value is “no”.

anonymous_enable=NO

Looks like this:

disable ftp anonymous login

Step 3 – Also make sure the “local_enable” line is uncommented and its value is YES.

local_enable=YES

as shown in my screenshot below:

local enable yes

Step 4 – Now find this “chroot_local_user” line and uncomment (remove the # symbol) and make sure its value is YES.

chroot_local_user=YES

So it looks similar like this:

chroot local user

What does “chroot_local_user=YES” mean? If this line is enabled, all the local users will be jailed within their chroot. It means access to any other part of the server will be denied.

Step 5 – That’s it. Well, basically there are several other configurations you can change / adjust according on your like. But what I’ve mentioned above are the most common settings ensuring your server to get the basic security level for its ftp connection. So once done editing, save that file by hitting Control+O then Control+X to exit.

Step 6 – Finally, restart the vsftpd service by using this command:

service vsftpd restart

It should return with OK message in the “starting vsftpd for vsftpd”.

restart vsftpd

Step 7 – The very lest step, issue this command:

chkconfig vsftpd on

that last command is aimed to make vsftpd service automatically runs each time your server boot or reboot.

chkconfig

That’s all. Now you can access your server via ftp connection. You can firstly try via your browser by typing:

ftp://domain.com

in my case it looks like this:

login ftp via browser

Alternatively, you can use your favorite ftp client like FileZilla.

What’s next? Read my previous guide about how to use SFTP to upload and manage files on your server. Alright, have a nice day and let me know if you have curiosity in your mind regarding this topic. Follow me on Twitter to get faster update.

13 Comments

Add a Comment

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.