3

I can not get TFTP to work properly on my system. I have set /etc/default/tftpd-hpa to /srv/tftp/ which I have set to permissions 777 like all the contents as well (and /srv/ too) however, whenever I do a get test I get a timeout, (and I'm connected on my localhost to 127.0.0.1). I don't think TFTP logs somewhere, does it? Any assistance on how to debug this would be greatly appreciated!

EDIT #1

This is on a (K)Ubuntu system and /srv and its contents were owned by root:root, I changed this now to nobody:nogroup but I still get the same timeout:

$ ls -la
total 12
drwxrwxrwx 3 nobody nogroup 4096 Nov  5 08:47 .
drwxrwxrwx 3 nobody nogroup 4096 Nov  5  2013 ..
drwxrwxrwx 2 nobody nogroup 4096 Nov  5  2013 artifacts
-rwxrwxrwx 1 nobody nogroup    0 Nov  5 08:48 test
-rw-r--r-- 1 reg    reg        0 Nov  5 08:47 vx.bin
reg@ubuntu:/srv/tftp$tftp 127.0.0.1
tftp> get test
Transfer timed out.

EDIT #2

After realizing that seemingly there'ss no instance of tftp running, I tried to launch it with #tftp and then Ubuntu told me, that I should do apt-get install cobbler to install cobbler, that's what I did and then I tried again and got the following:

# tftpd
Traceback (most recent call last):
  File "/usr/sbin/tftpd", line 51, in <module>
    import tornado.ioloop as ioloop
ImportError: No module named tornado.ioloop
root@ubuntu:/srv# 

What does this mean, I'm wondering, any clues?

  • 1
    What's the underlying OS? Might be an issue with app armor of SELinux blocking access to this directory. Also I don't think it should matter but what's the owner/group for the dir. /srv/tftp? Should be nobody:nobody. – slm Nov 6 '13 at 0:45
  • My preference is atftpd it seems to have better logging, and better defaults for timeouts. In any case, start your debugging by looking at wireshark/tcpdump maybe? tftp has no encryption, so you should be able to see exactly what is going on. – Zoredache Nov 6 '13 at 0:46
2

I've had to deal with this myself a few times recently and these are the questions I've asked myself to trouble shoot:

  • is tftpd run from xinetd or as an independent daemon?
  • do you need to alter /etc/hosts.allow or hosts.deny
  • is SELinux enabled (check with "getenforce" command)?
  • is there a host firewall running? (service iptables status)
  • are you sure of the directory tftpd is useing as it's data dir?
  • does the file you are attempting to "get" actually exist?

My bet is on a combination of the above. Like firewall and SELinux and data directory location.

You do not want /srv to be open with modes 0777. And you don't need to do that with the tftp data dir, either. You'll only need to the files readable by world. Unless you are putting files onto the server. In that case, you must create the files ahead of time and make them world writable while you are writing them.

Good luck!

  • Well, since I can establish a session with tftp 127.0.0.1 I assume that the daemon is working properly... no iptables firewall running (this is an out of the box Ubuntu install, so SELinux shouldn't be the issue either). My config file /etc/default/tftpd-hpa says TFTP_DIRECTORY="/srv/tftp" but # ps ax | grep tftpd doesn't return anything (other than the instance of grep) :o that's odd, so how would I be able to establish a cionnection then? – cerr Nov 6 '13 at 17:00
2

I ended up following this guide that explains that openbsd-inetd should be installed as well and I also had to set RUN_DAEMON="yes" in my tftp config file at /etc/default/tftpd-hpa.

UPDATE #1

The above link no longer worked so I found an alternative here, titled: Running TFTP Server on Ubuntu 12.04 LTS (Precise) UPDATE.

1

I just had this problem on Debian Jessie: "Transfer timed out.".

In /etc/default/tftpd-hpa, there is a line for the address: TFTP_ADDRESS="0.0.0.0:69".

Replace it with the full server address. For example:

TFTP_ADDRESS="192.168.99.10:69"

And restart the daemon. That seems to have fixed it for me.

This variable in Debian sets the --address option to the daemon. You may need to set it differently on a different distribution, but in the end you should see the address when doing ps x:

# ps x | grep tftp
3988 ?        Ss     0:00 /usr/sbin/in.tftpd --listen --user tftp --address 192.168.99.10:69 --secure /docs/tftp-pxe

Looks like a bug in either the server or the client.

0

If this is CentOS/Fedora you can enable verbose messaging from TFTP like so. I nthe config file /etc/xinetd.d/tftp, change the server_args variable to this:

server_args = -v -v -l /var/log/tftpd

Be sure to restart the server. You can add additional -v switches to be more verbose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.