TL;DR for how to install vsftpd
ftp service on ubuntu operating system.
apt-get install vsftpd
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
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>
Related article: How to download files using curl on Linux operating systems