Installing a tftp server on CentOS and Fedora Linux servers


While upgrading the firmware on several network devices this past weekend, I needed to bring up a tftp server so the clients could retrieve the firmware image. I had a Fedora host readily available, so getting tftp up and working was super easy. Before configuring the server, I ran yum to install the tftp-server package:

$ yum install tftp-server

Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tftp-server.x86_64 0:0.49-3.fc11 set to be updated
--> Processing Dependency: xinetd for package: tftp-server-0.49-3.fc11.x86_64
--> Running transaction check
---> Package xinetd.x86_64 2:2.3.14-22.fc11 set to be updated
--> Finished Dependency Resolution
........

Once the package was installed, I set “disable” to no in /etc/xinetd.d/tftp (I also disabled the server as soon as I was done using it):

$ cat /etc/xinetd.d/tftp

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

After the server was configured, I restarted xinetd and everything worked like a champ. If you encounter any issues tftp’ing files, there are a couple of things you can do to troubleshoot the source of the problem:

  1. Add one or more “-v” (verbose output) directives to the /etc/xinetd.d/tftp “server_args” line
  2. Start the tftp client by hand, and set the “verbose” and “trace” options
  3. Fire up tethereal to decode the TFTP requests and responses

While tftp is completely insecure, it’s still one of those protocols that we have to live with.

This article was posted by Matty on 2009-07-15 09:16:00 -0400 -0400