使用者工具

網站工具


service:tftpd:tftpd

ubuntu 安裝 tftp server

1、安裝相關軟件包

sudo apt-get install tftpd (服務端)
sudo apt-get install tftp (客戶端)
sudo apt-get install xinetd

2、建立配置文件

cd /etc/xinetd.d/
vi tftp

輸入

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

3、建立tftp服務文件目錄

sudo mkdir /tftpboot
sudo chmod 777 tftpboot/

4、從新啟動服務

/etc/init.d/xinetd restart

5、安裝完成!測試方法:

檢查一下tftp是否真的在運作

$ sudo netstat -anp | grep tftp
udp 0 0 0.0.0.0:69 0.0.0.0:* 5249/in.tftpd
unix 2 [ ] DGRAM 17654 5249/in.tftpd

新版看不到是 in.tftpd 有能是 xinetd, 所以有 udp:69 即是OK了

在/tftpboot 目錄下隨便放個文件abc,然後運行

tftp localhost

進入tftp命令行,輸入

get abc

看看是不是能把文件下下來,如果可以就可以了,也可以put文件上去。

service/tftpd/tftpd.txt · 上一次變更: 2019/11/16 08:12 由 127.0.0.1