tftp is Multi-threaded TFTP server implementing all options (option extension and multicast) as specified in RFC1350, RFC2090, RFC2347, RFC2348 and RFC2349. Atftpd also supports multicast protocol known as mtftp, defined in the PXE specification. The server supports being started from inetd as well as in daemon mode using init scripts.

Install atftp Server in Ubuntu

sudo aptitude install atftpd

This will complete the installation

Using atftpd

By default atftpd server starts using inetd so we need to tell atftpd to run as a server directly, not through inetd.Edit /etc/default/atftpd file using the following command

sudo gedit /etc/default/atftpd

Change the following line

USE_INETD=true

to

USE_INETD=false

save and exit the file

Now you need to run the following command

sudo invoke-rc.d atftpd start

Configuring atftpd

First you need to create a directory where you can place the files

sudo mkdir /tftpboot

sudo chmod -R 777 /tftpboot

sudo chown -R nobody /tftpboot

sudo /etc/init.d/atftpd restart

Security configuration for atftp

Some level of security can be gained using atftp libwrap support. Adding proper entry to /etc/hosts.allow and /etc/hosts.deny will restrict access to trusted hosts. Daemon name to use in these files is in.tftpd.

/etc/hosts.allow /etc/hosts.deny

in.tftpd : FQD or IP

atftp client installation

Advance Trivial file transfer protocol client,atftp is the user interface to the Internet ATFTP (Advanced Trivial File Transfer Protocol), which allows users to transfer files to and from a remote machine. The remote host may be specified on the command line, in which case atftp uses host as the default host for future transfers.

sudo aptitude install atftp

That’s it you are ready to transfer your files using tftp clients

Testing tftp server

Tranfering file hda.txt from 192.168.1.100 (Client using tftp) to 192.168.1.2 (Server 192.168.1.100). Get an example file to transfer (eg. hda.txt)

cd /srv/tftp

touch test.txt

ls -l /srv/tftp/

total 0
-rwxrwxrwx 1 ruchi ruchi 223 test.txt

cd /tmp

atftp 192.168.1.2

atftp> get test.txt

Sent 722 bytes in 0.0 seconds

atftp> quit

ls -l /tmp/

total 4
-rwxrwxrwx 1 ruchi ruchi 707 2008-07-07 23:07 test.txt


紅色部分 為阿謙改寫, 主要是 因為 ubuntu 10.10 在安裝 atftpd 時 ,
就會在 /srv/ 目錄下建立名稱為 tftp 的子目錄.
該子目錄為 atftpd 預設的根目錄.

透過 atftpd 的 put 上傳 或 get 下傳 的 檔案 都會放在這裡
簡單點講 ,就是如果你要透過 tftp 傳輸檔案 ,則只要把檔案放在 /src/tftpd 目錄下即可

原文取自: http://www.ubuntugeek.com/howto-setup-advanced-tftp-server-in-ubuntu.html


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Frank 的頭像
    Frank

    經驗交流分享與備忘

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