11.3 简单文件传输协议

Trivial File Transfer Protocol,TFTP:简单文件传输协议,是FTP协议的简化版,基于UDP协议,占用端口为69

相关的软件安装包,tftp:客户端程序,tftp-server:服务端程序,xinetd:服务管理程序

  1. 安装相关软件包

# dnf install -y tftp-server tftp xinetd
  1. tftp所对应的配置文件默认不存在,需要用户根据示例文件(/usr/share/doc/xinetd/sample.conf)自行创建

# vim /etc/xinetd.d/tftp
service tftp
{ 
        socket_type             = dgram
        wait                    = yes
        user                    = root
        server                  = /usr/etc/in.tftpd
        server_args             = -s /tftpboot
        disable                 = no
}
  1. 重启服务,加入开机启动项,防火墙放行UDP 69端口

# systemctl restart tftp
# systemctl enable tftp

# systemctl restart xinetd
# systemctl enable xinetd

# firewall-cmd --permanent --zone=public  --add-port=69/udp
# firewall-cmd --reload 
  1. TFTP的根目录为/var/lib/tftpboot/,测试效果

实验环境

客户端/服务器:Windows + Tftpd4

客户端/服务器:Linux +tftp环境

两者互相双向测试

最后更新于