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_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.