1、安装相关软件包
sudoapt-getinstalltftpd(服务端)
sudoapt-getinstalltftp(客户端)
sudoapt-getinstallxinetd
2、建立配置文件
cd/etc/xinetd.d/
sudovimtftp
输入
servicetftp
{
socket_type=dgram
protocol=udp
wait=yes
user=root
server=/usr/sbin/in.tftpd
server_args=-s/tftpboot
disable=no
per_source=11
cps=1002
flags=IPv4
}
存盘退出
3、建立tftp服务文件目录
sudomkdir/tftpboot
sudochmod777/tftpboot-R
4、从新启动服务
sudo/etc/init.d/xinetdrestart
安装完成!
测试:
/nfsroot/rootfs/button$tftp192.168.2.75
tftp>puthello.c
Sent1018bytesin0.0seconds
tftp>gethello.c
Received1018bytesin0.1seconds
tftp>putbook.c
Sent1980bytesin0.0seconds
tftp>getbook.c
Received1980bytesin0.0seconds
注:nfsroot/rootfs/button预先有hello.cbook.c
下载本文示例代码
阅读(578) | 评论(0) | 转发(0) |