Linux服务器配置---tftpserver

安装tftp-server

1、安装tftp-server

[root@localhost weijie]# yum install -y tftp-server

Loaded plugins: fastestmirror, refresh-packagekit, security

Running Transaction

  Installing : tftp-server-0.49-8.el6.i686                                  1/1 

  Verifying  : tftp-server-0.49-8.el6.i686                                  1/1 

Installed:

  tftp-server.i686 0:0.49-8.el6                                                

Complete!

 

2、打开配置文件“/etc/xinetd.d/tftp“ 

[root@localhost weijie]# gedit /etc/xinetd.d/tftp 

service tftp

{

    socket_type       = dgram

    protocol      = udp

    wait          = yes

    user          = root

    server        = /usr/sbin/in.tftpd

    server_args       = -s /var/lib/tftpboot          //默认目录

    disable           = no                                //是否启动

    per_source    = 11

    cps        = 100 2

    flags         = IPv4

}

 

3、修改防火墙,允许udp端口号69

[root@localhost weijie]# gedit /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT

 

4、重启服务

[root@localhost weijie]# service iptables restart               //重启防火墙

iptables:将链设置为政策 ACCEPTfilter nat                [确定]

iptables:清除防火墙规则:                                 [确定]

iptables:正在卸载模块:                                   [确定]

iptables:应用防火墙规则:                                 [确定]

iptables:载入额外模块:nf_conntrack_ftp                   [确定]

You have new mail in /var/spool/mail/root

[root@localhost weijie]# service xinetd restart              //重启xinetdtftp依赖xinetd服务

停止xinetd                                             [确定]

正在启动xinetd                                          [确定]

 

5、测试

[root@localhost weijie]# tftp 192.168.1.8           //连接服务器

tftp> get 11.c                                           //获取文件

tftp>quit                                               //退出

You have new mail in /var/spool/mail/root

[root@localhost weijie]# ls                           //查看文件,已经获取到

1   11.c  1.zip  2.c.bz2  4.c  6.c~  rec000012.c.bz2

1.  1.c   2.c    3.c      5.c  col   res.zip

     

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值