I have been searching for a solution that worked for configuring a TFTP Server service on my Ubuntu 9.10 Linux server and have yet to find one that provides a working answer. So, I write my own.
For this example we will use atftp daemon, which is apparently the best solution for Linux at the time of this article.
Install atftpd
Obviously the installation requires root access, so make sure that you sudo.
1. root@server:/# apt-get install atftpd
Configure atftpd
1. root@server:/# vi /etc/default/atftpd
We are going to change USE_INETD to false and then if you feel like it, remove some of the options. Be sure to add the option “–daemon”, as shown below:
USE_INETD=false
OPTIONS=”–tftpd-timeout 300 –retry-timeout 5 –maxthread 100 –verbose=5 –daemon /var/lib/tftpboot/”
If you do not add the –daemon option, then atftpd daemon will not start when you restart with /etc/init.d/atftpd restart. Instead it will display the atftpd options, as though you ran the binary file from /usr/sbin/atftpd.
If you are interested in learning about the options, be sure to read the atftpd man page.
2. root@server:/# /etc/init.d/atftpd restart
This command will restart the deamon with the new settings.
Testing the TFTP Server
The final step, unless you think you are totally awesome or trust my articles, is to test the TFTP server to make sure that it works. You can accomplish this from a Windows machine by running a command similar to (the -i means binary trasnfer):
1. C:\tftp -i server_address put picture.gif
From a Linux machine, you can install tftp (apt-get install tftp).
Other Notes
I didn’t like the default location of /var/lib/tftpboot/ for the files to be stored. I have a directory called /datastore/ that I put all of my files into for backup purposes.
After attempting to configure atftpd to use a different location, such as changing the path specified in /etc/default/atftpd, I was unable to change to a new location. With that stated, I made a symbolic link in /datastore/ to point to /var/lib/tftpboot/, which is good enough for me.
1. root@server:/datastore# ln -s /var/lib/tftpboot/ ./tftproot