在fc6上搭tftpd

公司的开发环境依然停留在fc6上,,,,对..很旧,旧到想死.html

 

我在没有进一步熟悉ubuntu的基础上,为了保持ABI一致.chrome

只能依旧在FC6 上开发.ubuntu

 

但是如今发现开发完成,我要在fc6上文件到win7,再win7 winscp过去arm板,,,,,,痛啊.服务器

想了老半天,问了一下同事,他说能够在win7上开个tftpd我想了一下,能不能再省一点功夫,less

直接在fc6上开一个.socket

若是..我FC6能够上网能够用yum之类,就秒搞定,测试

但是不行.ui

因而我只好四处找tftpd的安装方法.spa

通过在kenel中找到tftpd 的src以后,仍是发现须要xinet......net

以后一系列的设置,

看来那个用src

configure

make

make install

的办法于我不行.

因而我就进行了rpm包的查找,,以后,发现FC21的版本太新了.不行,

因而我就找回了

FC6的xinetd

及tftpd

以后就是按顺序安装,再

2,修改/etc/xinetd.d/tftp文件,把disable前面加一个#
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
# disable = yes
per_source = 11
cps = 100 2
flags = IPv4
}

 

因为以前的防火墙已关掉,

cd /

mkdir tftpboot

chmod 777 -R /tftpboot/

 

service xinetd restart

搞定.

---------------后来发现

发现想回传文件的时候,不能写入

查了一下,tftpd通常来讲能够读文件,写文件,但写入的文件必须存在,如不存在就写入(也就是至关于建立的话)须要修改

也就是上面的配置改为

server_args = -c -s /tftpboot

再运行chmod -R 777 /tftpboot

再service xinetd restart

tftpd启动的参数.

转下文

 http://blog.chinaunix.net/uid-26939498-id-3801710.html

 

TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行文件传输的简单协议,主要基于UDP协议来实现。该协议最初设计的目的是进行小文件的传输,所以它不具有一般的FTP的许多功能,它只能从TFTP服务器上得到或 入文件,不能列出目录,不进行认证。
1.tftp的配置文件
[root@localhost Desktop]# gedit /etc/xinetd.d/tftp
1    # default: off
 2    # description: The tftp server serves files using t he trivial file transfer \
 3    #    protocol.  The tftp protocol is often used to boot diskless \
 4    #    workstations, download configuration files to network-aware printers, \
 5    #    and to start the installation process for some operating systems.
 6    service tftp
 7    {
 8        socket_type        = dgram
 9        protocol        = udp
10        wait            = yes
11        user            = root
12        server            = /usr/sbin/in.tftpd
13        server_args        = -s /tftpboot
14        disable        = no
15        per_source        = 11
16        cps            = 100 2
17        flags            = IPv4
18    }
其中,server_args = -s /tftpboot是tftp服务器运行时的参数。-s /tftpboot表示服务器默认的目录是/tftpboot,当执行put a.txt命令时,文件被放到服务器的路径是/tftpboot/a.txt。
能够执行tftp、get命令下载文件。在嵌入式开发中,多使用下载功能。
能够执行put命令上传文件。上传文件时,须要先把服务器上的/tftpboot目录和这个目录下的文件变成可读可 权限,能够执行以下命令: [root@localhost Desktop]# chmod -R 666 /tftpboot 默认状况下,只能上传tftp服务器已经存在的文件,例如,在tftp服务器上有/tftpboot/a.txt这个文件,能够执行以下命令: [root@localhost Desktop]# put a.txt 若是想上传tftp服务器目录中没有的文件,须要修改tftp服务器的配置文件, 将/etc/xinetd.d/tftp文件的第13行改成“server_args = -s /tftpboot -c”便可,而后重启tftp服务器。 2.重启tftp服务器 [root@localhost Desktop]# service xinetd restart 中止 xinetd:                                              [肯定] 启动 xinetd:                                              [肯定] [root@localhost Desktop]#  3.测试tftp [root@localhost Desktop]# netstat -a|grep tftp udp        0      0 *:tftp                      *:*                                      [root@localhost Desktop]# netstat -an|grep 69|grep udp udp        0      0 0.0.0.0:69                  0.0.0.0:* udp        0      0 :::56996                    :::*                                     执行上面两条命令中的任何一条,若是有相关的输出,就代表tftp服务器配置成功。 注:tftp服务器使用UDP协议,使用的端口号是69。
相关文章
相关标签/搜索