AFP548

Setting Up the TFTP Server in Tiger

As the networking infrastructure guy, I occasionally have the need to update hardware or backup settings using the TFTP protocol. I’ve noticed that there are plenty of good instructions for how to make this work with Panther, but almost none for Tiger.Tweaking TFTP in Panther required editing a file in /etc/xinetd.d/ that no longer exists in Tiger since xinetd has been deprecated in favor of launchd. No worries, however, because you can make TFTP work in Tiger, it’s just that the steps to get there are a bit different. It requires use of the Terminal, but you’re good enough, you’re smart enough, and… we’ll leave it at that.

Tiger starts the TFTP service based on settings specified in a file named /System/Library/LaunchDaemons/tftp.plist. That file contains the command to start the daemon and the optional switches associated with it. By default, the only switch in the plist file is “-i /private/tftpboot”, which is separated out into two individual program arguments, but is logically a single option. According to the man page for tftpd, the -i option means “Enable insecure mode, no realpath”. In all honesty, I’m not sure what that means precisely, but it sounds like no filesystem path is assigned to where TFTP can read and write files. We can fix that.

The first thing to do is make a backup copy of the original tftp.plist file because if bad things happen, we want the ability to start over clean. In the Terminal, copy it with this line:

<code>sudo cp /System/Library/LaunchDaemons/tftp.plist ~/Desktop</code>

Let the editing begin!

<code>sudo nano /System/Library/LaunchDaemons/tftp.plist </code>

Find this line:

<code>&lt;string&gt;-i&lt;/string&gt;</code>

and replace

<code>-i</code>

with

<code>-s</code>

Find this line:

<code>&lt;string&gt;/private/tftpboot&lt;/string&gt;</code>

and replace it with

<code>&lt;string&gt;/path/where/you/want/files/saved&lt;/string&gt;</code>

(/Users/yourname/Public might be a good choice.)

Press control-x to exit and save the plist file.

Start up the TFTP server:

<code>sudo service tftp start</code>

If you’re using Mac OS X’s built-in firewall, be sure to open UDP port 69.

TFTP is a purposely dumb protocol. It requires no authentication, so it can’t create files and can only write to files that are publicly writable. So before any data can be saved via TFTP to a file, that file has to be created and made publicly writable at the local machine by the user.

To create a file:

<code>touch /path/to/file.name</code>

And then to make it publicly writable:

<code>chmod 777 /path/to/file.name</code>

After a hard day of TFTPing, the service can be stopped with:

<code>sudo service tftp stop</code>
Exit mobile version