现在的位置: 首页 > 综合 > 正文

ubuntu12.04 搭建tftp服务器

2014年09月05日 ⁄ 综合 ⁄ 共 857字 ⁄ 字号 评论关闭
1. $ sudo apt-get install tftpd tftp openbsd-inetd

2. sudo gvim /etc/inetd.conf

找到如下配置:

#:BOOT: TFTP service is provided primarily for booting. Most sites
# run this only on machines acting as "boot servers."
#tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp  (/srv/tftp 为默认tftp目录)

配置自己的tftp目录:
        tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /home/nitonggui/tftp

3.创建目录:mkdir /home/nitonggui/tftp ; 修改文件权限为777

4.$sudo /etc/init.d/openbsd-inetd restart

5.查看69端口是否有打开 :netstat -an | more| grep udp

udp 0 0 0.0.0.0:69 0.0.0.0:*

6.本机测试:

      a.在/home/nitonggui/tftp目下新建一个文件,并写入数据:
       #gedit 123.txt        
      b. 到/home目录下
        #tftp 221.204.110.99[注:这是本机的IP地址]
          tftp> get 123.txt
        Received 12 bytes in 0.0 seconds
        tftp> quit

        #ls /home
         行了,本地测试成功!

7.在开发板上使用tftp
        只需要将开发板和主机设在同一网段即可。

抱歉!评论已关闭.