說明:本操作是通過Secure CRT SSL連接虛擬機安裝的Linux centos5.3操作,虛擬機的IP 192.168.171.156, 本機XP系統的IP 192.168.171.82
連接上Secure CRT SSL 開始如下操作:
1、#rpm -qa |grep tftp
2、#cd /mnt
3、[mnt]#mkdir guazai
4、[mnt]#mount /dev/cdrom guazai
5、[mnt]#cd guazai
6、[mnt]#cd CentOS
7、[CentOS]#ls *ftp*
ftp-0.17-35.el5.i386.rpm tftp-0.42-3.1.el5.centos.i386.rpm
gftp-2.0.18-3.2.2.i386.rpm tftp-server-0.42-3.1.el5.centos.i386.rpm
lftp-3.5.1-2.fc6.i386.rpm vsftpd-2.0.5-12.el5.i386.rpm
8、[CentOS]#rpm -ivh tftp-server-0.42-3.1.el5.centos.i386.rpm
Preparing... ########################################### [100%]
1:tftp-server ########################################### [100%]
9.[CentOS]# ########################################### [100%]
[root@localhost CentOS]# rpm -ivh tftp-0.42-3.1.el5.centos.i386.rpm
Preparing... ########################################### [100%]
1:tftp ########################################### [100%]
10.[root@localhost CentOS]# rpm -qa|grep tftp
tftp-server-0.42-3.1.el5.centos
tftp-0.42-3.1.el5.centos
11.[root@localhost CentOS]# vi /etc/xinetd.d/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 /tftpboot '加-c
disable = yes '改為no
per_source = 11
cps = 100 2
flags = IPv4
}
#該后的代碼
# 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 /tftpboot -c
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
~
:wq (保存退出)
11.[root@localhost CentOS]#cd /
12.[root@localhost /]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
13.[root@localhost /]# setup '查看TFTP是否開機自動開啟(系統服務選項) 查看防火牆是否開放TFTP埠,並在其他埠選項增加埠69
:udp ,保存退出setup界面
14.[root@localhost /]# ls
backups dev lib misc opt sbin sys usr
bin etc lost+found mnt proc selinux tftpboot var
boot home media net root srv tmp
15.[root@localhost /]# cd tftpboot/
16.[root@localhost tftpboot]# ls
17.[root@localhost tftpboot]# cd /
18.[root@localhost /]# chmod 777 tftpboot
19.[root@localhost /]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
20.[root@localhost /]# cd tftpboot/
21.[root@localhost tftpboot]# ls
22.[root@localhost tftpboot]# touch test.txt 111 222 333
23.[root@localhost tftpboot]# ls
test.txt 111 222 333
24.[root@localhost tftpboot]# vi test.txt
test
zuo ge ce shi!
25.[root@localhost tftpboot]# cd /
26.[root@localhost /]# mkdir test
27.[root@localhost tftpboot]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:74:82:3B
inet addr:192.168.171.156 Bcast:192.168.171.255 Mask:255.255.254.0
28.[root@localhost /]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=4.13 ms
29.[root@localhost /]# ping 192.168.171.156 (本linux系統IP)
PING 192.168.171.156 (192.168.171.156) 56(84) bytes of data.
64 bytes from 192.168.171.156: icmp_seq=1 ttl=64 time=0.414 ms
64 bytes from 192.168.171.156: icmp_seq=2 ttl=64 time=0.088 ms
30.[root@localhost /]# cd test
31.[root@localhost test]# tftp 192.168.171.156
32.tftp> get test.txt
33.tftp> q
34.[root@localhost test]# ls
test.txt
35.[root@localhost test]# cat test.txt
test
zuo ge ce shi!
35.[root@localhost test]# touch aa.txt
36.[root@localhost test]# vi aa.txt
test
shi fou ce shi cheng gong ne!
:wq (保存退出)。
37.[root@localhost test]# tftp 192.168.171.156
38.tftp> put aa.txt
39.tftp> q
40.[root@localhost test]# cd /tftpboot/
41.[root@localhost tftpboot]# ls
111 222 333 aa.txt test.txt
42.[root@localhost tftpboot]# cat aa.txt
test
shi fou ce shi cheng gong ne!
43.[root@localhost tftpboot]# ping 192.168.171.82
PING 192.168.171.82 (192.168.171.82) 56(84) bytes of data.
64 bytes from 192.168.171.82: icmp_seq=1 ttl=64 time=0.960 ms
64 bytes from 192.168.171.82: icmp_seq=2 ttl=64 time=1.00 ms
44.在本機XP上上傳、下載
在運行裡面輸入cmd
C:\Documents and Settings\Administrator>d:
D:\>dir
D:\ 的目錄
2009-11-23 14:05
[火星人 ] CentOS5.3下安裝Tftp 原創已經有188次圍觀