How to install and configure a TFTP server on 14.04

I've been trying to build a TFTP server on a fresh Ubuntu 14.04 build for a number of weeks using articles that I've found on-line, but all my attempts seem to fail as the TFTP server that I've installed seems not to be responding. It doesn't matter if I GET or PUT, I always get a timeout error.

The most recent articles that I've tried are:

  • How do I install and run a TFTP server?
  • http://community.spiceworks.com/how_to/100006-install-and-configure-tftp-under-ubuntu-14-04

Both of these have been unsuccessful, each time with the TFTP client complaining of a timeout error.

I've added (or at least I think I have) rules to the UFW and iptables to allow access to UDP port 69, but without any success.

I have been building my base Ubuntu 14.04 OS from the mini.iso file I've downloaded from the Ubuntu download pages on to a VirtualBox VM (ver 4.3.8 r92456) running on my Win7 pro machine. No additional packages were installed during the initial build, but I have installed SSH and NTP (both of which appear to be working) post initial build. The TFTP client is running from my Win7 machine and the Ubuntu machine has a static IP address.


The connection is being made from a remote TFTP client on my Win7 machine.

$ netstat -apu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 *:tftp                  *:*                                 8166/xinetd
udp        0      0 test.paumaz.local:ntp   *:*                                 1332/ntpd
udp        0      0 localhost:ntp           *:*                                 1332/ntpd
udp        0      0 *:ntp                   *:*                                 1332/ntpd
udp6       0      0 fe80::250:56ff:febe:ntp [::]:*                              1332/ntpd
udp6       0      0 localhost:ntp           [::]:*                              1332/ntpd
udp6       0      0 [::]:ntp                [::]:*                              1332/ntpd

$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 localhost:mysql         *:*                     LISTEN
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp6       0      0 [::]:http               [::]:*                  LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
udp        0      0 *:tftp                  *:*
udp        0      0 test.paumz.local:ntp    *:*
udp        0      0 localhost:ntp           *:*
udp        0      0 *:ntp                   *:*
udp6       0      0 fe80::250:56ff:febe:ntp [::]:*
udp6       0      0 localhost:ntp           [::]:*
udp6       0      0 [::]:ntp                [::]:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     7010     @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     7559     /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     SEQPACKET  LISTENING     7370     /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     9458     /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     STREAM     LISTENING     9209     /var/run/acpid.socket

Solution 1:

Install following packages.

sudo apt-get install xinetd tftpd tftp

Create /etc/xinetd.d/tftp

sudo nano /etc/xinetd.d/tftp

and put this entry

service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
}

Create a folder /tftpboot this should match whatever you gave in server_args. mostly it will be tftpboot

sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpboot

Restart the xinetd service.

sudo /etc/init.d/xinetd restart

You must allow udp port 69 in firewall.

Edit 1

enter image description here

Like I say, first tftp localhost, then get ....

Give output cat /var/log/syslog | grep tftp

Solution 2:

Just the same problem here. Old Ubuntu 9.? that has upgraded to 14.04 by clicking "Yes". User is defined from "before" (default everything).

I've found it to work with:

tftp AAA.DDD.DDD.RRR  
get test  
^D  

cat test

This works, where AAA.DDD.DDD.RRR is the actual IP of my own machine.
(I currently have a static local offline net, so eg: tftp 192.168.1.1 is given as command)
Replacing this numeric address with the word "localhost" ==> Timeout at "get"
(it seems to connect ok, but it can't get the files).