1. sudo apt-get install tftpd tftp openbsd-inetd
2. sudo vi /etc/inetd.conf
#:BOOT: TFTP service is provided primarily for booting. Most sites
# run this only on machines acting as "boot servers."
#tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp (/srv/tftp 爲默認tftp目錄)#修改如下文件
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftproot
3.sudo mkdir /tftproot
4.sudo chmod 777 /tftproot
5.sudo /etc/init.d/openbsd-inetd restart
6.查看69端口是否有打開 :netstat
-an | more | grep udp
udp 0 0 0.0.0.0:69 0.0.0.0:*
7.本機測試:
a. 在/tftproot 下新建文件1.txt
b. 在其他目錄下測試:
tftp 127.0.0.1
tftp> get 1.txt
Received 12 bytes in 0.0 seconds
tftp> quit