Objective
The objective is to setup FTP server on Ubuntu 18.04 Bionic Beaver using VSFTPD daemon.
Operating System and Software Versions
- Operating System: – Ubuntu 18.04 Bionic Beaver
- Software: – vsftpd: version 3.0.3 or higher
Requirements
Privileged access to your Ubuntu System as root or via sudo
command is required.
Conventions
- # – requires given linux commands to be executed with root privileges either directly as a root user or by use of
sudo
command - $ – requires given linux commands to be executed as a regular non-privileged user
Other Versions of this Tutorial
Instructions
VSFTPD installation
First, step is to install VSFTPD daemon. Open up terminal and enter:
$ sudo apt-get install vsftpd
Configure FSFTPD server
Before we do anything, let’ make a backup of a current FSFTPD server configuration file:
$ sudo mv /etc/vsftpd.conf /etc/vsftpd.conf_orig
Create a new VSFTPD configuration file /etc/vsftpd.conf
using your favorite text editor eg.:
$ sudo nano /etc/vsftpd.conf
I suggest you start with the below basic FTP server configuration, confirm that it is working and later fine-tune it to suit your specific environment needs:
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
pasv_enable=Yes
pasv_min_port=10000
pasv_max_port=10100
allow_writeable_chroot=YES
Insert the above FTP configuration lines into /etc/vsftpd.conf
file.

In case you have UFW firewall enabled, execute the bellow command to allow incoming traffic to FTP ports:
$ sudo ufw allow from any to any port 20,21,10000:10100 proto tcp
Visit the following page on more options on how to allow FTP incoming traffic via UFW firewall.
All done. Restart VSFTPD server to apply new changes:
$ sudo service vsftpd restart
Create FTP user
At this stage we are ready to create a FTP user. The following lines will create a new system account ftpuser
:
$ sudo useradd -m ftpuser $ sudo passwd ftpuser Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
For testing purposes create some arbitrary file within ftpuser
‘s home directory. Once we login we should be able to see and edit this file:
$ sudo bash -c "echo FTP TESTING > /home/ftpuser/FTP-TEST"
Your FTP server configuration is done. If you wish to use FTP on anything else than your local network, then you are suggested to configure SFTP server to add additional security to your FTP connections.
Connect to FTP server
By now all should be ready for user ftpuser
to connect and login to our new FTP server. Given that your new FTP server can be resolved via host name ubuntu-ftp
you can either use ftp
command to login:
$ ftp ubuntu-ftp Connected to ubuntu-ftp. 220 (vsFTPd 3.0.3) Name (ubuntu-ftp:lubos): ftpuser 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. -rw-r--r-- 1 0 0 12 Feb 15 08:34 FTP-TEST -rw-r--r-- 1 1001 1001 8980 Apr 20 2016 examples.desktop 226 Directory send OK. ftp>
Or to make a FTP connection using any GUI FTP client. The simplest could be to use a Nautilus file manager which should be already installed on your system:

Open Nautilus and click on Other Locations
. Enter ftp://FTP-SERVER-HOSTNAME-OR-IP-ADDRESS
and click Connect
.
Enter FTP user’s credentials.