Linux中TFTP使用详解

您所在的位置:网站首页 手机上的百度文库怎么退出 Linux中TFTP使用详解

Linux中TFTP使用详解

2023-11-08 14:06| 来源: 网络整理| 查看: 265

FTP协议简介 TFTP是用来下载远程文件的最简单网络协议,它其于UDP协议而实现。

linux服务器端tftp-server的配置

1、安装tftp服务器 需要安装xinetd(守护tftp)、tftp和tftp-server 3个软件 1)如果能上网,通过yum安装: sudo yum install xinetd sudo yum install tftp sudo yum install tftp-server

2、配置tftp服务器 修改/etc/xinetd.d/tftp文件,将其中的disable=yes改为disable=no。开启TFTP服务 主要是设置TFTP服务器的根目录,开启服务。修改后的文件如下: service tftp {     socket_type            =dgram        protocol                  =udp        wait                        =yes        user                        =root        server                     =/usr/sbin/in.tftpd        server_args             =-s /home/mike/tftpboot -c        disable                    =no        per_source             =11        cps                         =100 2        flags                       =IPv4 } 说明:修改项server_args= -s         -c,其中处可以改为你的tftp-server的根目录

参数-s指定chroot,-c指定了可以创建文件。

3、启动tftp服务器并关闭防火墙

RedHat7+

systemctl disable firewall;systemctl stop firewall

systemctl enable xinetd;systemctl start xinetd

Redhat7- /etc/init.d/iptables stop        //关闭防火墙 sudo /sbin/service xinetd start 或service xinetd restart /etc/init.d/xinetd start 看到启动[OK]就可以了

4、查看tftp服务是否开启 netstat -a | grep tftp 显示结果为 udp 0 0 *:tftp *:* 表明服务已经开启,就表明tftp配置成功了。

5、tftp使用 复制一个文件到tftp服务器目录,然后在主机启动tftp软件,进行简单测试。

登陆 tftp 192.168.1.2 tftp>get tftp>put tftp>q

6、tftp命令用法如下 tftp     your-ip-address 【进入TFTP操作】 connect:连接到远程tftp服务器 mode:文件传输模式 put:上传文件 get:下载文件 quit:退出 verbose:显示详细的处理信息 tarce:显示包路径 status:显示当前状态信息 binary:二进制传输模式 ascii:ascii传送模式 rexmt:设置包传输的超时时间 timeout:设置重传的超时时间 help:帮助信息 ?:帮助信息

7、如果出现“AVC Denial, click icon to view”的错误,并不能传输文件 修改/etc/sysconfig/selinux,将SELINUX设定为disable 使用命令setenforce 0让selinux配置文件生效



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3