1、安装tftp服务
[root@cxishs-Nettest~]#yuminstall-ytftp-server Loadedplugins:fastestmirror,refresh-packagekit,security Loadingmirrorspeedsfromcachedhostfile SettingupInstallProcess ResolvingDependencies -->Runningtransactioncheck --->Packagetftp-server.x86_640:0.49-7.el6willbeinstalled -->ProcessingDependency:xinetdforpackage:tftp-server-0.49-7.el6.x86_64 -->Runningtransactioncheck --->Packagexinetd.x86_642:2.3.14-39.el6_4willbeinstalled -->FinishedDependencyResolution DependenciesResolved ====================================================================================================== PackageArchVersionRepositorySize ====================================================================================================== Installing: tftp-serverx86_640.49-7.el6c6-media39k Installingfordependencies: xinetdx86_642:2.3.14-39.el6_4c6-media121k TransactionSummary ====================================================================================================== Install2Package(s) Totaldownloadsize:161k Installedsize:317k DownloadingPackages: ------------------------------------------------------------------------------------------------------ Total2.6MB/s|161kB00:00 Runningrpm_check_debug RunningTransactionTest TransactionTestSucceeded RunningTransaction Installing:2:xinetd-2.3.14-39.el6_4.x86_641/2 Installing:tftp-server-0.49-7.el6.x86_642/2 Verifying:tftp-server-0.49-7.el6.x86_641/2 Verifying:2:xinetd-2.3.14-39.el6_4.x86_642/2 Installed: tftp-server.x86_640:0.49-7.el6 DependencyInstalled: xinetd.x86_642:2.3.14-39.el6_4 Complete! [root@cxishs-Nettest~]#
[root@cxishs-Nettest~]#vi/etc/xinetd.d/tftp #default:off #description:Thetftpserverservesfilesusingthetrivialfiletransfer\ #protocol.Thetftpprotocolisoftenusedtobootdiskless\ #workstations,downloadconfigurationfilestonetwork-awareprinters,\ #andtostarttheinstallationprocessforsomeoperatingsystems. servicetftp { socket_type=dgram protocol=udp wait=yes user=root server=/usr/sbin/in.tftpd server_args=-s/tmp/tftp/data-c##TFTP文件目录,-c表示支持上传 disable=no##开启服务,默认TFTP服务关闭 per_source=11 cps=1002 flags=IPv4 } ~ ~ ~ ~ ~ "/etc/xinetd.d/tftp"18L,514Cwritten [root@cxishs-Nettest~]# [root@cxishs-Nettest~]#mkdir/tmp/tftp [root@cxishs-Nettest~]#mkdir/tmp/tftp/data [root@cxishs-Nettest~]#chmod777/tmp/tftp [root@cxishs-Nettest~]#chmod777/tmp/tftp/data
3、重启并验证服务
[root@cxishs-Nettest~]#/etc/init.d/xinetdrestart Stoppingxinetd:[OK] Startingxinetd:[OK] [root@cxishs-Nettest~]#netstat-au|greptftp udp00*:tftp*:* [root@cxishs-Nettest~]#
使用感想:
在使用过程中,发现tftp服务器有假死现象,从客户端推送文件失败,而服务器上观察服务处于正常状态。
此时重启tftp服务后再次生效。因此,博主在计划任务里周期自动重启tftp服务,以保证tftp服务的可用性。
原文链接:https://www.f2er.com/centos/375115.html