Installing VSFTPD in Ubuntu 14.04/16.04 Servers

Installing and Configuring VSFTPD ftp server in CentOS and Ubuntu based systems

VSFTPD Installation on Ubuntu 14.04/16.04 :

Install the FTP server using the following command.
apt-get -y install vsftpd

Configuring VSFTPD Server :

Open the vsftpd Configuration File.

vim /etc/vsftpd.conf

anonymous_enable=NO
local_enable=YES
write_enable=YES

# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=NO

chroot_local_user=YES
# if you get 500 Internal error for ftp server add following line.
allow_writeable_chroot=YES

# if you get login incorrect error edit the pam_Service_name to ftp from vsftpd
pam_service_name=ftp

make the above changes and save the file

Now Create the FTP user :

useradd -d ‘/var/www/html’ -s /sbin/nologin ftpuser

change the password for the user.
passwd ftpuser

Now give all permissions on the home directory

chown -R ftpuser ‘/var/www/html/’
chmod 775 ‘/var/www/html/

Add to ftpusers group

groupadd ftpusers
usermod -G ftpusers ftpuser

Open the firewall port 21 for FTP
ufw allow 21

Now restart the vsftpd server
sudo service vsftpd restart

Then try to connect to the FTP server using any FTP client such as FileZilla with the ftpuser credentials.

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. Founder of SillyCodes. I am a programmer, Presently working as a Software Engineer in Hyderabad. I love Linux and Open Source. Apart from that, I love to explore new technologies and things.

You may also like...

2 Responses

  1. If anybody gets Apache 403 forbidden Error,

    Use /etc/vsftpd.conf

    local_umask=022

  2. D Stevens says:

    Re user creation: in Ubuntu 14.04.2 LTS, there is no script /sbin/nologin; you will need to use /usr/sbin/nologin instead.

Leave a Reply

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