tftp服務(wù)器搭建三步走
我們了解了tftp服務(wù)器的一些基礎(chǔ)內(nèi)容后,就要著手于對tftp服務(wù)器搭建的學(xué)習(xí)了。那么下面,我們將這個搭建過程作了一個簡單的總結(jié),希望大家能夠通過文章的內(nèi)容,對這部分有所領(lǐng)悟。
tftp服務(wù)器搭建1.檢查系統(tǒng)是否安裝tftp服務(wù)端軟件:
[root@localhost lqm]# rpm -qa |grep tftp
tftp-0.39-2
tftp-server-0.39-2
tftp服務(wù)器搭建2.編輯文件:/etc/xinetd.d/tftp
[root@localhost xinetd.d]# vi tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args =-s /home/lqm/tftpboot -c
disable = yes ---------------將yes改為no!
per_source = 11
cps = 100 2
flags = IPv4
注: 修改項server_args= -s -c,其中處可以改為你的tftp-server的根目錄,參數(shù)-s指定chroot,-c指定了可以創(chuàng)建文件。
tftp服務(wù)器搭建3.建立tftp文件夾
#mkdir /home/lqm/tftpboot
#chmod o+w /home/lqm/tftpboot
/etc/init.d/iptables stop //關(guān)閉防火墻
service xinetd restart //重啟 xinetd 服務(wù)
重啟xinetd服務(wù),因為TFTP服務(wù)受控與xinetd, xinetd是管服務(wù)的服務(wù),它是不開端口的。
驗證一下TFTP是否起來了:
[root@localhost tftp_root]# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::22 :::* LISTEN 2828/sshd
udp 0 0 0.0.0.0:69 0.0.0.0:* 10887/xinetd
udp 0 0 0.0.0.0:69 0.0.0.0:* 10863/in.tftpd
udp 0 0 0.0.0.0:69 0.0.0.0:* 10778/in.tftpd
可以看到69端口已經(jīng)打開,說明服務(wù)啟動正常。
#service xinetd restart
這樣,tftp-server就啟動了。你可以登陸本機測試以下,命令如下:
#tftp your-ip-address
tftp>get <download file>
tftp>put <upload file>
tftp>q
#