1、在虛機(jī)上安裝tftp服務(wù),
安裝:
先安裝xinetd 服務(wù):yum install xinetd
安裝tftp ,tftp-sever:yum install tftp tftp-sever
2、設(shè)置 :
a. 將/etc/xinetd.d/tftpd內(nèi)容改為:
service tftp
{
disable = no
socket_type = dgram
wait = no
user = root
protocol = udp
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
log_on_success = PID HOST DURATION
log_on_failure = HOST
}
b. chmod 777 /tftpboot
c. 修改/etc/default/tftpd-hpa
將文檔內(nèi)容修改為:
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /tftpboot"
3、 啟動
service xinetd restart
查看tftp是否啟動的命令是 netstat -a | grep tftp,如果查看不到,關(guān)閉防火墻/etc/init.d/iptables stop
4、文件傳輸
在虛機(jī)(192.168.1.113)下/var/lib/tftpboot/test,在終端上運(yùn)行
tftp -g -r test 192.168.1.113即可把虛機(jī)上的文件傳到終端上
或是tftp -l test -r test -g 192.168.1.113