ubuntu 设置 tftp 服务

ubuntu 设置 tftp 服务的步骤:

1,安装相关软件包:tftpd(服务端),tftp(客户端),xinetd
$sudo apt-get install tftpd tftp xinetd 

2,建立配置文件

在 /etc/xinetd.d/ 下建立一个配置文件 tftp
$sudo gedit 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 /tftpboot
$sudo chmod 777 /tftpboot -R
4,重新启动服务
$sudo /etc/init.d/xinetd restart

至此 ubuntu tftp 服务已经安装完成了,下面对其进行测试(假设在当前目录下有一个测试文件 test.txt)
$tftp 127.0.0.1                      
tftp> put test.txt
Sent 1018 bytes in 0.0 seconds
tftp> get test.txt
Received 1018 bytes in 0.1 seconds
tftp> quit


如果出现无法get或者put的时候,可以查看一下防火墙是否关闭。


如果遇到错误提示信息 “Access violation”,表示文档没有读的权限

将档案 file1.txt 设为所有人皆可读取 :

$sudo chmod a+r file1.txt









发布了34 篇原创文章 · 获赞 8 · 访问量 9万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章