Install and configure tftpd-hpa

I will give an example of installing a tftpd server tftpd-hpa.

In Ubuntu, tftpd-hpa can be installed using the command:

sudo apt install tftpd-hpa

After installation, you need to edit the configuration file, open it in a text editor:

sudo nano /etc/default/tftpd-hpa

The default directory is /var/lib/tftpboot/, which owns the root user, so you can only download files from the TFTP server.
I specified another directory, also added “create” so that I could create files and ipv4 so that the server listened to only ipv4 addresses, or you can indicate in the “TFTP_ADDRESS” what IP address the server should work:

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--ipv4 --secure --create"

Create a directory for files and assign rights:

sudo mkdir /srv/tftp
sudo chown tftp:tftp /srv/tftp

Restart the TFTP server to apply the changes:

sudo /etc/init.d/tftpd-hpa restart

Now files can be downloaded and sent to a TFTP server.

See also my articles:
IPTables rules for TFTP
Starting a TFTP server in Windows
Installing and Configuring a TFTP Server in Ubuntu

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a comment

Leave a Reply