天天看點

Linux伺服器---安裝tftp-server

安裝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:将鍊設定為政策 ACCEPT:filter nat                [确定]

      iptables:清除防火牆規則:                                 [确定]

      iptables:正在解除安裝子產品:                                   [确定]

      iptables:應用防火牆規則:                                 [确定]

      iptables:載入額外子產品:nf_conntrack_ftp                   [确定]

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

      [root@localhost weijie]# service xinetd restart              //重新開機xinetd,tftp依賴xinetd服務

      停止 xinetd:                                              [确定]

      正在啟動 xinetd:                                          [确定]

5、測試

      [root@localhost weijie]# tftp 192.168.1.8           //連接配接伺服器

      tftp> get 11.c                                           //擷取檔案

      tftp> quit                                                //退出

      [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

繼續閱讀