Setting up TFTP server on Linux machine

From AcrodusWiki

Introduction

This guide explains how to set up and configure a tftp server on a linux machine using the tftpd-hpa package.

HOW TO

Set up

Ensure tftpd-hpa has been installed on the machine. This can be checked by running 'sudo apt install tftpd-hpa'. Ensure the service is active and enabled with the command 'sudo systemctl status tftpd-hpa'. To start the service run the command 'sudo systemctl start tftpd-hpa', this is not required if the service is already running. To make the service run when the machine is booted enter the command 'sudo systemctl enable tftpd-hpa', this is not required if the service is already enabled.

Configuration

The configuration file for the tftp server is located in the file /etc/default/tftpd-hpa. This allows you to configure the tftp root directory, username, ip address and port and additional option. When using the PUT command from the client ensure that the option --create is configured. Ensure there is no firewall rules preventing traffic on udp port 69.

Make sure the permissions are set correctly on the home path for the tftp server.

Example

/etc/default/tftpd-hpa

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