Native TFTP and FTP Server in OSX
As a System Engineer, I do occasionally have to do real field work. When that happens, having access to a TFTP and FTP server is sometimes required. Although the [lack of] UI makes the use counterintuitive, these tools are available in OSX. This post includes the commands required to enable, confirm, and disable both TFTP and FTP in the native Mac environment.
TFTP Server
//load the TFTP daemon (typically starts automatically) sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist //confirm that TFTP is listening (netstat) netstat -atp UDP | grep tftp --output-- udp6 0 0 *.tftp *.* //IPv6 Listening udp4 0 0 *.tftp *.* //IPv4 Listening //unload the TFTP daemon sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist //confirm that TFTP is no longer listening (netstat) netstat -atp UDP | grep tftp --no output--
TFTP Caveats
- Default Directory is /private/tftpboot
- Copying a file from a device to the TFTP server requires it be “pre” created (Hint: sudo touch /private/tftpboot/<filename>)
- File permissions typically need to be modified (Hint: sudo chmod 766 /private/tftpboot/*)
- I just use my TFTP directory for transient file transfers
FTP Server
//load the FTP daemon (typically starts automatically) sudo launchctl load -w /System/Library/LaunchDaemons/ftp.plist //confirm that FTP is listening (netstat) netstat Continue reading
