redhat tftp安装与配置

tftp 安装:

1.下载软件包

以到http://www.kernel.org/pub/software/network/tftp/   下载
tftp-server-0.43-1.i386.rpm和tftp-hpa-0.48.tar.gz(可能有更新版本的)两个包,可能第一个rpm包可
以不要的,第二个包就包含了服务器和客户端

2.安装tftp-server-0.43-1.i386.rpm 服务器
[root]# rpm -ivh --nodeps tftp-server-0.43-1.i386.rpm,此时根目录下会多一个tftpboot的目录,是tftp的共享目录

3.编译安装tftp-hpa-0.48.tar.gz
[root]# tar vxfz   tftp-hpa-0.48.tar.gz
[root]# cd tftp-hpa-0.48
[root]# make
[root]# make install

tftp配置:

1、修改文件在linux下,不管使用的是哪一种super-server,inetd或者xinetd,默认情况下TFTP服务是禁用的,所以要修改文件来开启服务。

根据(1)的安装方法,可以修改文件/etc/xinetd.d/tftp。主要是设置TFTP服务器的根目录,开启服务。

修改后的文件如下:

service tftp {    

socket_type            =dgram       

protocol                  =udp       

wait                        =yes       

user                        =root       

server                     =/usr/sbin/in.tftpd       

server_args             =-s /home/app -c       

disable                    =no       

per_source             =11       

cps                         =100 2       

flags                       =IPv4

}

说明:修改项server_args= -s     <path>    -c,其中<path>处可以改为你的tftp-server的根目录,参数-s指定chroot,-c指定了可以创建文件。

 

2、创建tftp根目录,关闭防火墙,启动tftp-server。

#mkdir /tftpboot

#chmod o+w       /tftpboot  

#/etc/init.d/iptables stop        //关闭防火墙

#service xinetd restart          //重启 xinetd 服务

如果之前tftpboot里有东西,如果执行下面测试时就要先改了那文件的属性

chmod o+w $文件名

3、测试

验证一下TFTP是否起来了:

# netstat -nlp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN 3122/rpc.statd

tcp 0 0 127.0.0.1:32781 0.0.0.0:* LISTEN 4035/xinetd

tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3103/portmap

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3324/httpd

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3255/sshd

tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3213/cupsd

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3295/sendmail: acce

tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3415/0

tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3324/httpd

udp 0 0 0.0.0.0:32768 0.0.0.0:* 3122/rpc.statd

udp 0 0 0.0.0.0:69 0.0.0.0:* 4035/xinetd   ;

可以看到69端口已经打开

udp 0 0 0.0.0.0:69 0.0.0.0:* 4012/in.tftpd

udp 0 0 0.0.0.0:111 0.0.0.0:* 3103/portmap

udp 0 0 0.0.0.0:754 0.0.0.0:* 3122/rpc.statd

udp 0 0 0.0.0.0:631 0.0.0.0:* 3213/cupsd

这样,tftp-server就启动了。

你可以登陆本机测试以下,命令如下:

#tftp     your-ip-address

tftp>get <download file>

tftp>put <upload file>

tftp>q  

 

测试可能出现问题见另一文章

 

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值