CentOS部署TFTP服务

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~]#


2、修改TFTP配置文件

[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服务的可用性。

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native