How to install and configure VSFTPD (FTP server) on Fedora/ CentOS /Ubuntu

You can install vsftpd on Ubuntu / Debian, CentOS /Fedora and RHEL linux.

Installing vsftpd on Ubuntu or Debian

Installing vsftpd on CentOS / Fedora

How to configure vsftpd:

Now that you.ve installed vsftpd, follow this procedure to configure it. These steps applies for both the linux variants.

Before you get started, stop the vsftpd by typing:

Edit the vsftp.conf

In Ubuntu / Debian:

In Red Hat / CentOS

Make the following changes:

We don.t want anonymous login:

Enable local users:

The ftpuser should be able to write data:

Port 20 need to turned off, makes vsftpd run less privileged:

Chroot everyone:

set umask to 022 to make sure that all the files (644) and folders (755) you upload get the proper permissions.

Now that basic configuration is complete, now let us begin with locking / securing a directory to user.

Setup a password for the user:

In order to enable the ftpuser read and write the data in your home dir, change the permission and take ownership:

Create userlist file and add the user:

Ubuntu / Debian:

CentOS / Fedora

and add the user:

save the file and open the vsftp.conf file again:

Add the following lines at the end of the file and save it:

After completing all these procedures it is almost ready to use it, give it a try but you will get a 500 OOPS permission denied error. To fix it you need to add a nologin to the shell set.

The file should look like this:

Add this line at the end:

Now create a usergroup and add the ftpuser to it:

Now start the vsftpd:

That.s it. Now you have a secure installation of vsftpd on your server.

The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

Leave a Reply