Skip to content

Instantly share code, notes, and snippets.

@briantissue
Created January 24, 2015 02:30
Show Gist options
  • Save briantissue/0925058707641841f18a to your computer and use it in GitHub Desktop.
Save briantissue/0925058707641841f18a to your computer and use it in GitHub Desktop.
Ubuntu TFTP Setup for Cisco Devices
# Bash Script for setting up tftpd-hpa for cisco devices
# Run As Root
# Check if root
if [ "$(whoami)" != "root" ]; then
echo "Not running as root. Exiting..."
exit 0
else
echo "Running as root. Good"
fi
# Update Reps
apt-get update
# Create TFTP directory
mkdir /srv/tftp
chmod 777 /srv/tftp
# Install TFTPD-HPA
apt-get install tftpd-hpa
# Adding necessary configuration for Cisco device to upload to server
rm -r /etc/default/tftpd-hpa
echo '# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --create -v"' >> /etc/default/tftpd-hpa
# Restart TFTPD Service
restart tftpd-hpa
echo TFTP SUCCESFULLY INSTALLED
echo CISCO IMAGES AND CONFIGS ARE STORED IN /SRV/TFTP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment