在ubuntu下安装tftp服务器软件以及安装客服端软件
第一步:安装服务器软件以及客服端软件和xinetd服务
Apt-get install tftp-hpa tftpd-hpa xinetd
第二步:修改tftp服务的配置文件tftpd-hpa
Vi /etc/default/tftpd-hpa
修改下面两项:
TFTP_DIRECTORY=”/tftpboot”-------------------这里一定要修改和这个相同的目录(后面阐释原因)
TFTP_OPTIONS=”-l -c -s”
第三步:启动tftp服务器:
Service tftpd-hpa start
或者重起:service tftpd-hpa restart
启动xinetd服务:service xinetd restart
第四步:tftp服务器测试
Tftp ip
>get filname---------------------从服务器上下载文件(/tftpboot)
>put filname----------------------从当前目录上传文件到服务器(/tftpboot)
为什么只能用/tftpboot这个目录作为tftp服务器的目录:(由于xinetd这个服务冲突了)-------这里由于时间原因我就没有去查解决方案,如果自己有想法的可以到网上去找下具体原因
在windows下通过tftp服务器从linux的tftp服务器上上传或者下载文件:
Windows的默认目录就是打开终端那个绝对路径:
>tftp ip(linux服务器ip) get filename----------------------从linux服务器下载文件
>tftp ip(linux服务器ip) put filename-----------------------从当前目录上传文件到linux服务器(/tftpboot)
在操作文件传输之前注意需要关闭防火墙:
Linux:service iptables stop
Windows:在控制面板关闭防火墙