之前參考這篇文章

[ubuntu] TFTP Server 安裝

來設定Host的 tftp server 環境,只可惜我怎樣試了又試,還是體會不到成功的快感!

一度以為是防火牆的問題,似乎也不是,inetd 也裝了,就是不給面子。

後來乾脆全部移除掉:

~$:sudo -s

~$:apt-get remove –purge tftpd tftp inetutils-inetd

然後重裝 xinetd 與 tftpd, tftp

~$:apt-get install xinetd tftpd tftp

原先已經系統中還保留舊的 inetd.conf 檔,需要 mark 掉 tftpd 的啟動命令如下:

#tftp        dgram    udp    wait    nobody    /usr/sbin/tcpd    /usr/sbin/in.tftpd /tftpboot

接著用 vim 新增一個檔案:

~$:vim /etc/xinet.d/tftp

檔案內容如下:

service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
}

再來,重新啟動 xinetd(tftpd必須透過 xinetd 這不用廢話了吧,當然也可有standalone的方式):

~$:/etc/init.d/xinetd restart

關於伺服器的目錄設定:

~$:mkdir /tftpboot

~$:chown -R nobody:\  /tftpboot

~$:chmod -R 777 /tftpboot

接著可以利用 client 端程式 tfpt 127.0.0.1 利用 get 指令下載檔案!

#我真的很討厭重複做無聊的事情……………….