Chinaunix首页 | 论坛 | 博客
  • 博客访问: 39470
  • 博文数量: 17
  • 博客积分: 310
  • 博客等级: 二等列兵
  • 技术积分: 145
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-16 10:18
文章分类
文章存档

2012年(16)

2011年(1)

我的朋友

分类: LINUX

2012-08-15 14:03:59

1. Install tftpd and related packages.

点击(此处)折叠或打开

  1. $ sudo apt-get install xinetd tftpd tftp

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

 点击(此处)折叠或打开

  1.  sudo vi /etc/xinetd.d/tftp

点击(此处)折叠或打开

  1. service tftp
  2. {
  3. protocol = udp
  4. port = 69
  5. socket_type = dgram
  6. wait = yes
  7. user = nobody
  8. server = /usr/sbin/in.tftpd
  9. server_args = /tftpboot
  10. disable = no
  11. }

3. Make /tftpboot directory

点击(此处)折叠或打开

  1. $ sudo mkdir /tftpboot
  2. $ sudo chmod -R 777 /tftpboot
  3. $ sudo chown -R nobody /tftpboot

4. Start tftpd through xinetd

点击(此处)折叠或打开

  1. $ 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)


点击(此处)折叠或打开

  1. $ touch /tftpboot/hda.txt
  2. $ chmod 777 /tftpboot/hda.txt
  3. $ ls -l /tftpboot/
  4. total 0
  5. -rwxrwxrwx 1 davids davids 0 2006-03-27 23:04 hda.txt
  6. $ tftp $ touch /tftpboot/hda.txt
  7. $ chmod 777 /tftpboot/hda.txt
  8. $ ls -l /tftpboot/
  9. total 0
  10. -rwxrwxrwx 1 davids davids 0 2006-03-27 23:04 hda.txt
  11. $ tftp 127.0.0.1
  12. tftp> put hda.txt
  13. Sent 722 bytes in 0.0 seconds
  14. tftp> quit
  15. $ ls -l /tftpboot/
  16. total 4
  17. -rwxrwxrwx 1 davids davids 707 2006-03-27 23:07 hda.txt
  18. tftp> put hda.txt
  19. Sent 722 bytes in 0.0 seconds
  20. tftp> quit
  21. $ ls -l /tftpboot/
  22. total 4
  23. -rwxrwxrwx 1 davids davids 707 2006-03-27 23:07 hda.txt

阅读(679) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~