linux教程tftp,Ubuntu下tftp的安装

1. sudo apt-get install tftp-hpa tftpd-hpa

sudo apt-get install xinetd

sudo apt-get install  netkit-inetd

2. cd /

sudo mkdir /tftpboot

sudo chmod 777 /tftpboot

3. sudo in.tftpd -l /tftpboot

这样tftp服务器就启动了,下面可以做一个测试

4. cd /tftpboot

touch test

建立一个文件

5. cd /home/usrname

登录另一个目录

6. tftp 192.168.0.59

换成自己的ip

> get /tftpboot/test

打开目录 /etc/xinetd.d/

新建文件tftp

tftp内容:

service tftp

{

disable = no

socket_type     = dgram

protocol            = udp

wait                    = yes

user             = root

server          = /usr/sbin/in.tftpd

server_args     = -s /tftpboot -c

per_source      = 11

cps         = 100 2

}

重新启动服务:

sudo /etc/init.d/xinetd restart

sudo in.tftpd -l /tftpboot

安装过程中出现的问题及原因

现象一:

tftp> get test.log

Transfer timed out.

原因:

tftpd服务没有启动

现象二:

tftp> get test.log

Error code 2: Only absolute filenames allowed

原因:

在/etc/xinetd.d/tftpd中设置的server_args为/etc/default/tftpd-hpa

cat /etc/default/tftpd-hpa

#Defaults for tftpd-hpa

RUN_DAEMON="no"

OPTIONS="-s /home/tftpd -c -p -U 077 -u tftpd"

设置的时候只要将server_args=改为你自己设定的服务器文件夹就行了

现象三:

tftp> put ex070416.log

Error code 1: File not found

原因:

指定的文件不存在;或tftpd启动参数中没有指定-c选项,允许上传文件0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值