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选项,允许上传文件

相关内容

    暂无相关文章