发布时间:2025-12-09 21:25:02 浏览次数:4
TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂、开销不大的文件传输服务。端口号为69。
先查看下yum源里是否有tftp软件包
[root@localhost test]# yum list |grep tftpsyslinux-tftpboot.noarch 4.05-15.el7 base tftp.x86_64 5.2-22.el7 base tftp-server.x86_64 5.2-22.el7yum安装tftp安装tftp-server
[root@localhost test]# yum install tftp-server安装成功后,在/etc/xinetd.d下生成配置文件tftp。
[root@localhost xinetd.d]# ls /etc/xinetd.dchargen-dgram daytime-dgram discard-dgram echo-dgram pure-ftpd tftp time-streamchargen-stream daytime-stream discard-stream echo-stream tcpmux-server time-dgram[root@localhost xinetd.d]# vi /etc/xinetd.d/tftp把disable=yes修改成no
service tftp{socket_type= dgramprotocol= udpwait= yesuser= rootserver= /usr/sbin/in.tftpdserver_args= -s /var/lib/tftpbootdisable= noper_source= 11cps= 100 2flags= IPv4}启动tftp服务,只需要重启xinetd服务
service xinetd restart查看69端口是否运行
[root@localhost xinetd.d]# netstat -nlp |grep 69udp 0 0 0.0.0.0:69 0.0.0.0:* 77308/xinetd unix 2 [ ACC ] STREAM LISTENING 18691 746/NetworkManager /var/run/NetworkManager/private-dhcpunix 2 [ ACC ] STREAM LISTENING 16974 740/gssproxy /run/gssproxy.sockunix 2 [ ACC ] STREAM LISTENING 16973 740/gssproxy /var/lib/gssproxy/default.sock防火墙设置(可选)
/sbin/iptables -I INPUT -p tcp --dport 69 -j ACCEPT/sbin/iptables -I INPUT -p udp --dport 69 -j ACCEPT/etc/rc.d/init.d/iptables saveservice iptables restartservice iptables status