Install FTP Server on Ubuntu 20.04

Photo by Gabriel Heinzer on Unsplash

Open any SSH tool like putty

Open SSH and execute following commands

sudo apt update
sudo apt install vsftpd
sudo service vsftpd status

Photo by Viktor Forgacs on Unsplash

Firewall configuration

sudo ufw allow 20/tcp
sudo ufw allow 40000:50000/tcp
sudo ufw allow 990/tcp
sudo ufw allow openssh
sudo ufw enable
sudo ufw status

Photo by Micah Williams on Unsplash

FTP User

sudo adduser ftpuser
sudo mkdir /home/ftpuser/ftp
sudo chown nobody:nogroup /home/ftpuser/ftp
sudo chmod a-w /home/ftpuser/ftp
sudo mkdir /home/ftpuser/ftp/files
sudo chown ftpuser:ftpuser /home/ftpuser/ftp/files

Photo by Sigmund on Unsplash

VSFTPD Configuration

listen=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
pasv_min_port=40000
pasv_max_port=50000user_sub_token=$USER
local_root=/home/$USER/ftp

Restart the VSFTPD

sudo systemctl restart vsftpd.service

Test Ftp

open command promt
ftp xxx.xxx.xxx.xxx (ip adress/domain)

Username
Password

tiptop, done

--

--

Hasan Hüseyin Özkaya

Code and Electronic person. Fan of digital transformation and IoT