6

I was using 14.04 before, and I was able to setup and make tftp server and client work. Now that I upgrade to 14.10, tftp server isn't working anymore

Here's what I did:

  1. Install the package.

    sudo apt-get install tftpd-hpa
    
  2. Edit config file as follows.

    sudo vi /etc/default/tftpd-hpa

    # /etc/default/tftpd-hpa
    TFTP_USERNAME="tftp"
    TFTP_DIRECTORY="/tftpboot"
    TFTP_ADDRESS="0.0.0.0:69"
    TFTP_OPTIONS="-s -c -l"
    
  3. Create TFTP folder.

    sudo mkdir /tftpboot
    sudo chmod -R 777 /tftpboot
    sudo chown -R nobody /tftpboot
    
  4. Restart the app to apply new configuration.

    sudo service tftpd-hpa restart
    

(Source)

At that time, I didn't know that tftpd-hpa is the package for TFTP server and tftp-hpa is for TFTP client so what I did was install another package for the TFTP CLIENT.

  1. Install the following packages:

    sudo apt-get install xinetd tftpd tftp
    
  2. Change permission of /etc/xinetd.d directory.

    sudo chmod –R 777 xinetd.d
    
  3. Create a file named tftp in /etc/xinetd.d and write the following:

    service tftp {
    socket_type = dgram
    protocol = UDP.
    WAIT = YES
    user = root
    server = /usr/sbin/in.tftpd
    server_args =-s /tftpboot
    disable = no
    per_source = 11
    cps = 100 2
    flags = IPv4
    }
    
  4. Save and exit.

  5. Create tftpboot directory and change permission.

    cd /
    sudo mkdir /tftpboot
    chmod –R 777 /tftpboot
    
  6. Restart the service

    sudo /etc/init.d/xinetd restart
    

This step by step process of installing TFTP server and another package for TFTP Client workis in 14.04 but not in 14.10, and I think that the 2nd installation and set up (sudo apt-get install xinetd tftpd tftp) is the culprit why TFTP server isn't working. I've already uninstalled the packages which I think isn't needed. But TFTP server still isn't working. What can I do to make TFTP server work?

4
  • I see no reason why it won't work on 14.10.
    – Pilot6
    May 28, 2015 at 13:54
  • @Pilot6 - Hi after reading your comment I realized that I may have done something that ruined the configuration/set up of TFTP server. I've added details in my post. Kindly read it if you have time. Thank you. :) May 29, 2015 at 2:15
  • Do what user3714598 described in second part of his post but DO NOT change permission of /etc/xinetd.d . It loosens the security of system and it is not needed. Feb 1, 2016 at 7:49
  • It's always a good idea to check the system logs. go to /var/log and look for tftpd and also take a look at syslog for clues.
    – s1mmel
    May 19, 2018 at 14:31

2 Answers 2

1

This works for me:

service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
}
1
  • 1
    How does this answer the question? Please explain the circumstances.
    – guntbert
    Jan 18, 2017 at 20:20
0

This is an old question, but for anyone looking for clarity my answer may help:

tftpd-hpa is a self-contained tftp server - it doesn't need xinetd configured to work, in fact some of the recommendations I've read will result in contention for port 69 between tftpd-hpa and xinetd!

The answer elsewhere on this page from user storm is an example. I'm sure this xinetd configuration works with some other tftp package, but I don't see how it could with tftpd-hpa.

Take a look at the default configuration for tftpd-hpa in /etc/default/tftpd-hpa:

# /etc/default/tftpd-hpa

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

Unless you need a solution with more options, you should make sure you do not configure xinetd to handle tftp or listen on port 69 (or just don't install it at all). Edit /etc/default/tftpd-hpa as per your needs and then run sudo systemctl restart tftpd-hpa and you should be good. You can verify with this:

$ sudo netstat -tulpn | grep 69
udp        0      0 0.0.0.0:69              0.0.0.0:*                           45262/in.tftpd
udp6       0      0 :::69                   :::*                                45262/in.tftpd

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .