Installing and setting TFTPD in Ubuntu

1. Install tftpd and related packages.

$ sudo apt-get install xinetd tftpd tftp

2. Create /etc/xinetd.d/tftp and put this entry:

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

3. Make /tftpboot directory

$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot

4. Start tftpd through xinetd

$ sudo /etc/init.d/xinetd start

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

sudo ufw disable    (firmware should be shut down)
tftp localhost
tftp> get test.txt
Received 7 bytes in 0.0 seconds
tftp> put test.txt
Sent 7 bytes in 0.0 seconds
tftp>


====
http://www.davidsudjiman.info/2006/03/27/installing-and-setting-tftpd-in-ubuntu/

你可能感兴趣的:(socket,server,ubuntu,File,service)