ubuntu tftp服务安装和配置

来源:互联网 发布:windows企业版 编辑:程序博客网 时间:2024/06/05 03:14
1、安装相关软件包:Ubuntu tftp(服务端),tftp(客户端),xinetd
sudo apt-get install tftpd tftp xinetd
 
2、建立配置文件
在/etc/xinetd.d/下建立一个配置文件tftp
sudo vim tftp
在文件中输入以下内容:
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}
保存退出
 
3、建立Ubuntu tftp服务文件目录(上传文件与下载文件的位置),并且更改其权限
sudo mkdir /tftpbootsudo chmod 777 /tftpboot -R
 
4、重新启动服务
sudo /etc/init.d/xinetd restart
至此Ubuntu tftp服务已经安装完成了,下面可以对其进行一下测试。(假设在当前目录下有一个测试文件test.txt)
$tftp 127.0.0.1                      tftp> put test.txtSent 1018 bytes in 0.0 secondstftp> get test.txtReceived 1018 bytes in 0.1 secondstftp> quit
如果遇到tftp Error on server : Access violation错误,请现在/tftpboot目录下生成一个与要上传的文件同名的文件,并修改起权限为777
touch test.txtchmod 777 test.txt

0 0