W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
我們曾經(jīng)在第11章中學(xué)習(xí)過vsftpd服務(wù)與TFTP服務(wù)。vsftpd是一款功能豐富的文件傳輸服務(wù)程序,允許用戶以匿名開放模式、本地用戶模式、虛擬用戶模式來進(jìn)行訪問認(rèn)證。但是,當(dāng)前的客戶端主機(jī)還沒有安裝操作系統(tǒng),該如何進(jìn)行登錄認(rèn)證呢?而TFTP作為一種基于UDP協(xié)議的簡單文件傳輸協(xié)議,不需要進(jìn)行用戶認(rèn)證即可獲取到所需的文件資源。因此接下來配置TFTP服務(wù)程序,為客戶端主機(jī)提供引導(dǎo)及驅(qū)動文件。當(dāng)客戶端主機(jī)有了基本的驅(qū)動程序之后,再通過vsftpd服務(wù)程序?qū)⑼暾墓獗P鏡像文件傳輸過去。
[root@linuxprobe ~]# yum install tftp-server
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package tftp-server.x86_64 0:5.2-11.el7 will be installed
--> Processing Dependency: xinetd for package: tftp-server-5.2-11.el7.x86_64
--> Running transaction check
---> Package xinetd.x86_64 2:2.3.15-12.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
tftp-server x86_64 5.2-11.el7 rhel 44 k
Installing for dependencies:
xinetd x86_64 2:2.3.15-12.el7 rhel 128 k
Transaction Summary
================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 172 k
Installed size: 325 k
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------
Total 1.7 MB/s | 172 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:xinetd-2.3.15-12.el7.x86_64 1/2
Installing : tftp-server-5.2-11.el7.x86_64 2/2
Verifying : 2:xinetd-2.3.15-12.el7.x86_64 1/2
Verifying : tftp-server-5.2-11.el7.x86_64 2/2
Installed:
tftp-server.x86_64 0:5.2-11.el7
Dependency Installed:
xinetd.x86_64 2:2.3.15-12.el7
Complete!
TFTP是一種非常精簡的文件傳輸服務(wù)程序,它的運(yùn)行和關(guān)閉是由xinetd網(wǎng)絡(luò)守護(hù)進(jìn)程服務(wù)來管理的。xinetd服務(wù)程序會同時監(jiān)聽系統(tǒng)的多個端口,然后根據(jù)用戶請求的端口號調(diào)取相應(yīng)的服務(wù)程序來響應(yīng)用戶的請求。需要開啟TFTP服務(wù)程序,只需在xinetd服務(wù)程序的配置文件中把disable參數(shù)改成no就可以了。保存配置文件并退出,然后重啟xinetd服務(wù)程序,并將其加入到開機(jī)啟動項中(在RHEL 7系統(tǒng)中,已經(jīng)默認(rèn)啟用了xinetd服務(wù)程序,因此在將其添加到開機(jī)啟動項中的時候沒有輸出信息屬于正常情況)。
[root@linuxprobe ~.d]# vim /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
[root@linuxprobe xinetd.d]# systemctl restart xinetd
[root@linuxprobe xinetd.d]# systemctl enable xinetd
TFTP服務(wù)程序默認(rèn)使用的是UDP協(xié)議,占用的端口號為69,所以在生產(chǎn)環(huán)境中還需要在firewalld防火墻管理工具中寫入使其永久生效的允許策略,以便讓客戶端主機(jī)順利獲取到引導(dǎo)文件。
[root@linuxprobe ~]# firewall-cmd --permanent --add-port=69/udp
success
[root@linuxprobe ~]# firewall-cmd --reload
success
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: