ftp - yusukew62/docs GitHub Wiki

tftp

インストール

tftp, tftp-server をインストールする
xinetd は依存関係でインストールされる

# yum install tftp tftp-server

xinetd.d の定義を修正する

# cd /etc/xinetd.d/
# vi tftp

tftpの定義で server_args と disable を設定変更する

# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -c -u root -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

iptables で 69/udp を有効にする

# cd /etc/sysconfig/
# cp -p iptables iptables.org
# vi iptables

設定前後の差分を確認

# diff -wu iptables.org iptables
--- iptables.org        2017-03-14 06:06:24.187999976 +0900
+++ iptables    2017-03-14 06:57:06.596712812 +0900
@@ -8,6 +8,7 @@
 -A INPUT -p icmp -j ACCEPT
 -A INPUT -i lo -j ACCEPT
 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
+-A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT
 -A INPUT -j REJECT --reject-with icmp-host-prohibited
 -A FORWARD -j REJECT --reject-with icmp-host-prohibited
 COMMIT

iptables と xinetd の設定反映

# service iptables restart
# service xinetd start

/var/lib/tftpboot のパーミッションを変更する

# chmod -R 777 /var/lib/tftpboot