如何安裝Ubuntu TFTP Server

 

安裝配置TFTP Server與Client
$ sudo apt-get install xinetd tftpd tftp
其中,tftpd為Server套件,tftp為Client套件。

在/etc/xinetd.d/目錄下建立一個tftp檔案。
$ sudo vim /etc/xinetd.d/tftp
然後新增下面內容: (要記得改user 和server_args)
service tftp
{
{
 
        protocol = udp
 
        port = 69
 
        socket_type = dgram
 
        wait = yes
 
        user = nobody
 
        server = /usr/sbin/in.tftpd
 
        server_args = /home/renee/tftpboot
 
        disable = no
}
}


在renee使用者的家目錄新增tftpboot目錄。(要記得改名稱)
$ sudo mkdir /home/renee/tftpboot
$
$ sudo chmod -R 777 /home/renee/tftpboot
$
$ sudo chown -R nobody /home/renee/tftpboot
重新啟動xinetd,就可以啟動TFTP Server。
$ sudo /etc/init.d/xinetd restart

傳輸測試,下面範例是在Sever端的tftpboot目錄下產生一個test.txt檔,然後透TFTP Client(127.0.0.1)連到TFTP Server(127.0.0.1),下載test.txt到Client當前目錄。
$ ifconfig > /home/renee/tftpboot/test.txt
$
$ tftp 127.0.0.1
t
tftp> get text.txt
R
Received 1445 bytes in 0.0 seconds
t
tftp> quit
$
$ ls
t
test.txt

arrow
arrow
    文章標籤
    TFTP Server
    全站熱搜

    JL8051 發表在 痞客邦 留言(0) 人氣()