Thursday, January 02, 2014

Installing a TFTP server using xinetd on Ubuntu

I recently had need to redo an old server that had been running an ancient Gentoo installation for which there was no longer a software upgrade path, so I chose to install Ubuntu on it. Part of the requirements of the server were that it runs a TFTP server for hosting files for configuring embedded devices. I had previously found an article on how to setup TFTP through inetd, but I could find it, so I'm cobbling this tutorial together from various sources.

  1. # apt-get install xinetd tftpd
  2. Ensure that the following lines are in the /etc/services file:
    1. tftp     69/tcp
    2. tftp     69/udp
  3. Open the /etc/xinetd.d/tftp file (create it if it doesn't exist) and ensure that it contains the following:
    # default: off
    # description: The tftp server serves files using the Trivial File Transfer \
    #    Protocol.  The tftp protocol is often used to boot diskless \
    #    workstations, download configuration files to network-aware printers, \
    #    and to start the installation process for some operating systems.
    service tftp
        socket_type     = dgram
        protocol        = udp
        wait            = yes
        user            = root
        server          = /usr/sbin/in.tftpd
        server_args     = -s /tftpboot
        disable         = no
  4. # /etc/init.d/xinetd restart
  5. Test the server:# tftp localhost
    tftp> get hello.txt
    Received 23 bytes in 0.1 seconds
    tftp> quit 
You should now be good to go. The (abridged) instructions for this were retrieved from this article.

No comments: