TFTP服务器的安装和使用

来源:互联网 发布:集思宝a5测量软件 编辑:程序博客网 时间:2024/05/22 17:56
1.下载TFTP服务器的安装包
sudo apt-get install tftpd xinetd

2.建立配置文件
在/etc/xinetd.d目录下建立一个配置文件tftp
sudo gedit   /etc/xinetd,d/tftp

添加内容如下:
service tftp   
{   
    socket_type = dgram   
    protocol = udp   
    wait = yes   
    user = root   
    server = /usr/sbin/in.tftpd   
    server_args = -s /tftpboot     ---》TFTP传输目录
    disable = no   
    per_source = 11   
    cps = 100 2   
    flags = IPv4   
}  

3.建立tftp服务文件目录
在上面的配置中有server_args = -s /tftpbppt,其中/tftpboot这个目录就是上传文件与下载文件的位置

创建/tftpboot目录:sudo mkdir /tftpboot
设置权限为777:sudo chmod 777 /tftpboot -R (-R的意思是包括它的子目录下所有内容)

4.重新启动tftp服务器
sudo /etc/init.d/xinetd restart

5.测试
查看是否开启成功:sudo netstat -a | grep tftp
若看到udp 0 0 *:tftp *:* 则表示成功

下载(在SecureCRT上):
tftp –g –r xxx   192.168.X.XXX

TFTP  
可以用两种服务组件搭建,只需要使用一种即可,要注意配置文件和服务组件的匹配

Transfer a file from/to tftp server

       -l FILE Local FILE   开发板上使用的文件名,可新建
       -r FILE Remote FILE  必须是Ubuntu已有文件名,
       -g      Get file
       -p      Put file
       -b SIZE Transfer blocks of SIZE octets

       tftp -l put.c  -r dst    -p 192.168.1.11 (ubuntu地址)
  开发板上文件名ubuntu文件名放入ubuntu的dst文件中,该文件必须已经存在,且other有可读可写权限
原创粉丝点击