Showing posts with label tftp. Show all posts
Showing posts with label tftp. Show all posts
Sunday, 18 December 2016

Run a TFTP Server on Mac OS X



To upgrade firmware or upload config backup on networking devices TFTP server often comes handy. In my job I usually have access tosuch server, but in some cases when network access is limited or not available I configure a TFTP server on my laptop. For Linux see: Install and run a TFTP server

Mac OS X has a tftp server included, it's eazy to start it and do a minor configuration. First see if there are any commands related to tftp.
apropos tftp
You should get answer like this.
tftp(1) - trivial file transfer program
tftpd(8) - DARPA Internet Trivial File Transfer Pro
You can start it with launchctl
sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist
To confirm it’s running use netstat to check what is listening on its port, traditionally port 69.
netstat -na |grep \*.69
Should get answer like this.
udp6       0      0  *.69                   *.*
udp4       0      0  *.69                   *.*
It's a good idea to symlink the tftpboot to a folder you have full control over because OS X El Capitan has strong security via its System Integrity Protection (SIP) which makes things more difficult.
cd /private/
sudo rm -rf tftpboot
mkdir /Users/<username>/tftpboot
sudo ln -s /Users/<username>/tftpboot tftpboot
sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist
sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist

When you’re not using the TFTP server, make sure to unload the service.
sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist
netstat -na |grep \*.69
The netstat should return nothing.

-cheers
Friday, 8 November 2013

Install and run a TFTP server


In some cases I need tftp server. The method to install the tftp server is very easy.

First install following packages.
$ sudo apt-get install xinetd tftpd tftp
Create /etc/xinetd.d/tftp and add code
service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
}
Create a folder  /tftpboot and modify privileges
$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot
Restart the xinetd service.
$ sudo /etc/init.d/xinetd restart
Now the tftp server is up and running. For MAC OS X see: Run a TFTP Server on Mac OS X

Note:
My install was on Ubuntu 13.10

Edit:
Oct, 2014 installed on Mint 17