1. Install tftpd and related packages.
- $ sudo apt-get install xinetd tftpd tftp
2. Create /etc/xinetd.d/tftp and put this entry:
- sudo vi /etc/xinetd.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
- }
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 127.0.0.1 (Client using tftp) to 127.0.0.1(Server
127.0.0.1 ). Get an example file to transfer (eg. hda.txt)
- $ touch /tftpboot/hda.txt
- $ chmod 777 /tftpboot/hda.txt
- $ ls -l /tftpboot/
- total 0
- -rwxrwxrwx 1 davids davids 0 2006-03-27 23:04 hda.txt
- $ tftp $ touch /tftpboot/hda.txt
- $ chmod 777 /tftpboot/hda.txt
- $ ls -l /tftpboot/
- total 0
- -rwxrwxrwx 1 davids davids 0 2006-03-27 23:04 hda.txt
- $ tftp 127.0.0.1
- tftp> put hda.txt
- Sent 722 bytes in 0.0 seconds
- tftp> quit
- $ ls -l /tftpboot/
- total 4
- -rwxrwxrwx 1 davids davids 707 2006-03-27 23:07 hda.txt
- tftp> put hda.txt
- Sent 722 bytes in 0.0 seconds
- tftp> quit
- $ ls -l /tftpboot/
- total 4
- -rwxrwxrwx 1 davids davids 707 2006-03-27 23:07 hda.txt
阅读(710) | 评论(0) | 转发(0) |