Setup: FTP server

# Setup FTP server
# Instructions are tested on: Ubuntu 18.04.3 LTS
apt install -y atftpd
sudo gedit /etc/default/atftpd
# – set USE_INETD=FALSE
# – Optional: To change directory to host FTP contents, change /srv/tftp in OPTIONS line
# – Optional: To have maximum log: change –verbose=7 and append –logfile /var/log/atftpd.log
sudo mkdir -p /srv/tftp
sudo chmod -R 777 /srv/tftp
sudo chown -R nobody /srv/tftp
# Vanilla contents
# USE_INETD=true
# # OPTIONS below are used only with init script
# OPTIONS="–tftpd-timeout 300 –retry-timeout 5 –mcast-port 1758 –mcast-addr 239.239.239.0-255 –mcast-ttl 1 –maxthread 100 –verbose=5 /srv/tftp"
# After changes
# USE_INETD=false
# # OPTIONS below are used only with init script
# OPTIONS="–tftpd-timeout 300 –retry-timeout 5 –mcast-port 1758 –mcast-addr 239.239.239.0-255 –mcast-ttl 1 –maxthread 100 –verbose=7 –logfile /var/log/atftpd.log ~/tftp"
# Run the service
sudo invoke-rc.d atftpd start
# Verify atftpd is running
netstat -lnp | grep ":69 "
# Use atftp FTP client to verify atftpd
apt install -y atftp
atftp localhost
# Make sure /etc/hosts is having following mapping otherwise localhost above command will not work
# 127.0.0.1 localhost
# Download an file from FTP server
get file_name_which_is_hosted_on_ftp