TFTP (Trivial File Transfer Protocol),是很常見的通訊協議用在一些小系統上,如 cisco 韌體更新、或是有些廠家會 BIOS 內建 tftp 下載 rom 檔功能。如此輕巧簡易的通訊協議就很常派上用場。
1. Install
Install following packages.
1
sudo apt-get install xinetd tftpd tftp
Create /etc/xinetd.d/tftp and put this entry
1
2
3
4
5
6
7
8
9
10
11service 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 this should match whatever you gave in server_args. mostly it will be tftpboot
1
2
3sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpbootRestart the xinetd service
1
2sudo /etc/init.d/xinetd stop
sudo /etc/init.d/xinetd start
Now our tftp server is up and running.
2. Testing our tftp server
Create a file named test with some content in /tftpboot path of the tftp server
1
2
3
4ls / > /tftpboot/test
sudo chmod -R 777 /tftpboot
ls /tftpboot/test -lh
-rw-r--r-- 1 thalib thalib 159 2010-03-05 20:48 testNow in some other system follow the following steps.
1 | tftp localhost |