Enabling TFTP on Mac OSX 10.7 (Lion)

Running Lion? Need a TFTP server? Install not my friends. It’s built in; here’s how to fire it up:

Starting TFTP from Terminal:

sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist
sudo launchctl start com.apple.tftpd

This will start the server and use the default path of: /private/tftpboot

This path is usable but you’ll want to adjust the permissions if you plan on transferring files TO your server. Alternatively, you can edit the default path to a less restrictive folder. I created a folder in my home folder at /Users/USERNAME/tftp where USERSNAME is your login name.

Once the folder is created, edit the config file located at: /System/Library/LaunchDaemons/tftp.plist and replace /private/tftpboot with the path of your new folder.

sudo nano /System/Library/LaunchDaemons/tftp.plist

Save the file and restart the service so it uses the new config:

sudo launchctl stop com.apple.tftpd
sudo launchctl start com.apple.tftpd

If you want to verify that tftp is running, you can use netstat and grep to display the listening port:

netstat -l | grep tftp

Which should output something like this:

udp6 0 0 *.tftp *.*
udp4 0 0 *.tftp *.*

Indicating that your machine is now listening for incoming TFTP connections.

Posted in OSX

Leave a Reply