This is an old revision of the document!


TFTP Server

Ubuntu 12.04 x86 in vmware player

The default TFTP suite is tftp-hpa. To install the following step is needed:

user@ubuntu:~$ sudo apt-get install xinetd tftpd tftp

The TFTP default directory is /var/lib/tftpboot. For convinience the following changes can be applied to the system:

  • Creation of a new directory for the server
  • setting the ownership for the tftp user
  • add user to the tftp group to have rights to the tftpd dirctory
user@ubuntu:~$ sudo mkdir -p /srv/tftpd
user@ubuntu:~$ sudo chown tftp:tftp /srv/tftpd
user@ubuntu:~$ sudo chmod 775 /srv/tftpd
user@ubuntu:~$ sudo usermod -a -G tftp user

Finally the server configuration for the TFTP server has to be changed:

user@ubuntu:~$ sudo nano /etc/default/tftpd-hpa

Change the following line to point to the new created directory:

TFTP_DIRECTORY="/srv/tftpd"

To restart the TFTP server type:

user@ubuntu:~$ sudo service tftpd-hpa restart

To test the server copy some file to the server and get it back with

user@ubuntu:~$ tftp 127.0.0.1 -c get <filename> 

Ubuntu 10.04 x86 in vmware player

user@ubuntu:~$ sudo apt-get install xinetd tftpd tftp

To cofigure TFTP the file /etc/xinetd.d/tftp must be created and filled with the following content. This configuration uses the directory /tftpboot.

service tftp
{
  socket_type             = dgram
  protocol                = udp
  wait                    = yes
  user                    = root
  server                  = /usr/sbin/in.tftpd
  server_args             = -s /tftpboot
  per_source              = 11
  cps                     = 100 2
}

<note> The directory requires at least the access authorisation “dr-xr-xr-x”. </note>

<note> After the configuration was changed the server should be restarted:

user@ubuntu:~$ sudo service xinetd restart

</note>

Firewall & port forwarding

TFTP uses port 69 UDP. This port must be opened. How to configure port forwarding on a Windows-XP host system is described here: Port Forwarding.

  • Last modified: 2022/08/04 15:04