Created
October 24, 2019 11:19
-
-
Save aakbar5/1167a8a1dab6738337826ea525bad3a4 to your computer and use it in GitHub Desktop.
Ubuntu: Setup FTP server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment