Chinaunix首页 | 论坛 | 博客
  • 博客访问: 384069
  • 博文数量: 69
  • 博客积分: 1992
  • 博客等级: 上尉
  • 技术积分: 1162
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-03 19:50
文章分类
文章存档

2015年(1)

2011年(55)

2010年(13)

分类: LINUX

2011-04-16 20:50:41

1、安装相关软件包
sudo apt-get install tftpd
(服务端)
sudo apt-get install tftp
(客户端)
sudo apt-get install xinetd

2
、建立配置文件
在根目录下建立TFTP文件夹,做为TFTP的根目录
$ mkdir ~/TFTP
$ chmod 777 ~/TFTP

  /etc/xinetd.d/目录下建立tftp配置文件:
# vim /etc/xinetd.d/tftp
输入:

service tftp

{

       socket_type     = dgram

       protocol        = udp  

       wait            = yes

       user            = root

       server          = /usr/sbin/in.tftpd

       server_args     = -s /home/alyan/TFTP 替换为你的目录,注意权限。

       disable         = no

       per_source      = 11

       cps             = 100 2

       flags           = IPv4

}

/etc/inetd.conf中关于tftp的部份注释掉:

#: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

3、从新启动服务
sudo   /etc/init.d/xinetd  restart


4
TFTP服务测试
1)、登录TFTP服务器
     $ tftp localhost
    tftp>
    tftp> put text   //
测试上传文件
    
~/TFTP 目录下将看到text文件

    tftp> get text   //
测试文件下载
    
退出tftp在该目录中将看到text文件。

5
、上传中产生的错误。
    
如果产生Error code 2: Access violation
    
则首先给要上传的文件赋予权限  666
          root@sdaiden-desktop:~# chmod 666 usb.c
       
下载同理:。
    OVER


参考 http://www.anshld.com/blog/post/1.html

 tftp安装配置.doc   


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