在安装之前,我们需要将镜像加载,在VM中通过下拉菜单【VM】|【Removable Devices】|【CD/DVD】|【Settings...】,选择Use Iso image来加载。
使用命令 mount /dev/cdrom /media,将光盘内容挂载到/media下
将安装包拷贝到/home下 使用命令:cp /media/Server/tftp-server-0.42-3.1.i386.rpm /home/
在使用命令:umount /media ,可以卸载挂载的光驱。
首先使用rpm -ivh tftp-server-0.42-3.1.i386.rpm 命令进行安装
可能出现错误:error: Failed dependencies:
xinetd is needed by tftp-server-0.42-3.1.i386
则先安装xinted ,使用命令: rpm -ivh xinetd-2.3.14-10.el5.i386.rpm
继续安装tftp ,使用命令:rpm -ivh tftp-server-0.42-3.1.i386.rpm
安装好tftp,系统会自动在根目录下创建tftpboot文件夹
修改配置文件,使用命令:vi /etc/xinetd.d/tftfp
修改后如下:
operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
使用命令:/etc/init.d/xinetd start启动tftp或者使用命令/etc/init.d/xinetd restart重启tftp。
使用命令: netstat -a |grep tftp,查看tftp是否启动成功
显示udp 0 0 *:tftp *:* ,表明启动成功。
进行tftp测试
在/tftp目录下创建一个test文件,向其中写入测试内容“hello tftp”。
使用命令:tftp 127.0.0.1进行测试
发现出现错误:bash: tftp: command not found
这是因为我们只安装了tftp server包 ,但是没有安装tftp命令包,将tftp-0.42-3.1.i386.rpm也拷贝到当前目录下,进行安装,就可以了。
这时候再输入:tftp 127.0.0.1
出现tftp> ,输入get test,就将tftp目录下的test文件下载到当前目录下,输入q退出tftp命令模式。可以发现当前目录下多了一个test文件,内容为“hello tftp”。