首页 / LINUX / linux-TFTP服务
linux-TFTP服务
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了linux-TFTP服务,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2055字,纯文字阅读大概需要3分钟。
内容图文
![linux-TFTP服务](/upload/InfoBanner/zyjiaocheng/941/27890aacab854831856ed64a0220694d.jpg)
1、TFTP协议简介
TFTP,全称是 Trivial File Transfer Protocol(简单文件传输协议),基于 UDP 实现,该协议简单到只能从远程服务器读取数据或向远程服务器上传数据。
2、TFTP实战
1>环境准备:centos7
192.168.100.101 tftp-server 192.168.100.20 tftp-client
server端和client端分别关闭防火墙,禁用selinux # systemctl disable firewall;systemctl stop firewall 修改/etc/sysconfig/selinux,将SELINUX设定为disable,使用命令setenforce 0让selinux配置文件生效
2>linux服务端 tftp-server 配置
安装tftp服务器,需要安装xinetd(守护tftp)、tftp和tftp-server 3个软件
[root@tftp-server ~]# yum install xinetd tftp tftp-server -y [root@tftp-server ~]# rpm -ql tftp-server /etc/xinetd.d/tftp /usr/lib/systemd/system/tftp.service /usr/lib/systemd/system/tftp.socket /usr/sbin/in.tftpd /usr/share/doc/tftp-server-5.2 /usr/share/doc/tftp-server-5.2/CHANGES /usr/share/doc/tftp-server-5.2/README /usr/share/doc/tftp-server-5.2/README.security /usr/share/man/man8/in.tftpd.8.gz /usr/share/man/man8/tftpd.8.gz /var/lib/tftpboot #/var/lib/tftpboot为存放数据的文件,也就是说从服务器端下载文件必须放于此目录下
修改/etc/xinetd.d/tftp文件,将其中的disable=yes改为disable=no。开启TFTP服务,启动服务。
3>启动tftp服务器,并查看是否开启
[root@tftp-server ~]# systemctl enable xinetd;systemctl start xinetd [root@tftp-server ~]# netstat -a | grep tftp udp 0 0 0.0.0.0:tftp 0.0.0.0:*
4>在tftp服务器目录,创建测试文件
[root@tftp-server ~]# echo hello > /var/lib/tftpboot/test
5>客户端安装tftp包,使用tftp工具从远程服务器下载文件
[root@tftp-client ~]# yum install tftp -y [root@tftp-client ~]# tftp 192.168.100.101 tftp> get test tftp> q [root@tftp-client ~]# ls anaconda-ks.cfg test [root@tftp-client ~]# cat test hello
6>tftp命令用法如下
tftp your-ip-address 进入TFTP操作: connect:连接到远程tftp服务器 mode:文件传输模式 put:上传文件 get:下载文件 quit:退出 verbose:显示详细的处理信息 tarce:显示包路径 status:显示当前状态信息 binary:二进制传输模式 ascii:ascii传送模式 rexmt:设置包传输的超时时间 timeout:设置重传的超时时间 help:帮助信息 ?:帮助信息
内容总结
以上是互联网集市为您收集整理的linux-TFTP服务全部内容,希望文章能够帮你解决linux-TFTP服务所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。