FTP service on the Ubuntu OS | How to install it

TL;DR for how to install vsftpd ftp service on ubuntu operating system.

apt-get install vsftpd
Specification:

OS Version: Ubuntu Os 18.04.3 (LTS) x64
vsftpd Version: 3.0.3

Full read!

File Transfer Protocol or FTP is used to access remote servers for file management operations. FTP typically “listens” on port 21, unless it’s protected by certificate and then the transfer is being issued via port 22 (SFTP).

Installation of FTP service on Ubuntu OS

  • Update operating system
bluegrid-edu:~# apt-get update
  • Install “vsftpd” service
bluegrid-edu:~# nano /etc/vsftpd.chroot_list
  • Add following configuration to “/etc/vsftpd.conf”:
user_sub_token=$USER
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
local_root=/home/$USER/Public_html
allow_writeable_chroot=YES
  • Create /etc/vsftpd.chroot_list and add usernames of the local users you want to be able to access the FTP server. We want one specific user on the system to be able to use FTP service so we created the user with the following command:
bluegrid-edu:~# useradd -m ftpuser
  • Create a password for the new user:
bluegrid-edu:~# passwd ftpuser

Create a public FTP directory:

bluegrid-edu:~# mkdir /home/ftpuser/Public_html

Now, open the /etc/vsftpd.chroot_list and insert only ftpuser in it, save the file, and restart the vsftpd service.

bluegrid-edu:~# systemctl restart vsftpd

Test the FTP login with FTP client

For the purpose of the educational approach, we’ll be testing the FTP service with one visual tool (Commander ONE for MacOS) and command-line tool tnftp for macOS.

Commander ONE

FTP service on the Ubuntu
FTP service on the Ubuntu | Commander ONE

tnftp

$ ftp [email protected]
Connected to 139.59.128.172.
220 (vsFTPd 3.0.3)
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
Remote directory: /home/ftpuser/Public_html
ftp>

Ivan Dabić

A man with a beard and glasses, wearing an orange hoodie and a black cap with a Hard Rock Cafe logo, stands with his arms crossed against a plain white background.

Ivan Dabić

Co-founder and CEO of BlueGrid.io, with a background in cloud infrastructure, distributed systems, monitoring, and security operations. He works closely with engineering teams to build and operate reliable systems while documenting both technical and organizational aspects of modern engineering work.

Ivan is a metalhead, and big fan of cyberpunk move genre. If you are his secret Santa go with Star Wars Lego box!

Share this post

Share this link via

Or copy link