To install and set up a TFTP server on Ubuntu or Debian Linux, follow these steps:
- Install the TFTP server software:
sudo apt-get update
sudo apt-get install tftpd-hpa
- Configure the TFTP server:
sudo nano /etc/default/tftpd-hpa
In the file, uncomment the line TFTP_USERNAME="tftp"
and set TFTP_DIRECTORY
to the location of the directory where files will be stored and served. For example:
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
- Create the TFTP directory and set permissions:
sudo mkdir /var/lib/tftpboot
sudo chmod -R 777 /var/lib/tftpboot
- Start the TFTP server:
sudo service tftpd-hpa start
Verify the TFTP server is running by attempting to transfer a file to or from the server using the tftp
command.