1、软件包安装

root用户或者普通用户使用sudo权限执行如下命令:

yum install xinetd tftp tftp-server        # root 用户执行
sudo yum install xinetd tftp tftp-server # 普通用户执行

2、tftp-Server服务配置

[root@localhost ~]# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot -c # 注意这行,如果允许上传,一定要加上参数 -c
disable = no # 这行默认为yes,改成no,允许
per_source =
cps =
flags = IPv4
}

3、启动tftp服务

[root@localhost ~]#systemctl restart xinetd.service
[root@localhost ~]# netstat -a | grep tftp
udp        0      0 0.0.0.0:tftp            0.0.0.0:*                          
udp6       0      0 [::]:tftp               [::]:*
[root@localhost ~]# netstat -tunap | grep :69
udp        0      0 0.0.0.0:69              0.0.0.0:*                           30014/xinetd        
udp6       0      0 :::69                   :::*                                1/systemd 

4、测试上传下载

C:\>d:

D:\>tftp 10.190.38.213 get test.log
传输成功: 1 秒 17 字节,17 字节/秒 D:\>tftp 10.190.38.213 put d:\readme
传输成功: 1 秒 474 字节,474 字节/秒 D:\>

5、常见问题处理

5.1 如果上传时出现"连接请求失败"的提示,请确保tftp服务的文件存放目录权限设置正确

  • 解决办法:chmod  0777  /var/lib/tftpboot

5.2 文件上传时提示:Error code 1: File not found

在/etc/xinetd.d/tftp配置文件中,server_args后加上 -c 选项,方可上传

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot -c
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

5.3 如客户端无法连接,或包timeout

请确认服务器iptables策略开放了UDP的 69 端口,并关闭了selinux服务。

iptables策略开放:

# 编辑iptables配置文件
[root@localhost ~]# vim /etc/sysconfig/iptables # sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [:]
:FORWARD ACCEPT [:]
:OUTPUT ACCEPT [:]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport -j ACCEPT
-A INPUT -p udp -m state --state NEW -m tcp --dport 69 -j ACCEPT

或者执行如下命令:

iptables -A INPUT -p udp --dprot 69 -j ACCEPT

CentOS7下tftp服务安装配置的更多相关文章

  1. CentOS7下RabbitMQ服务安装配置

    参考文档: CentOS7下RabbitMQ服务安装配置 http://www.linuxidc.com/Linux/2016-03/129557.htm 在linux下安装配置rabbitMQ详细教 ...

  2. CentOS7下RabbitMQ服务安装配置胜多负少

    RabbitMQ是流行的开源消息队列系统,是AMQP(Advanced Message Queuing Protocol高级消息队列协议)的标准实现,用erlang语言开发.RabbitMQ据说具有良 ...

  3. CentOS7下RabbitMQ服务安装配置 (亲测有效)

    erlang 21.3 rabbitmq-server 3.7.14 下载地址 链接: https://pan.baidu.com/s/1g_T1Q_6zpyO3AepS0ZPgYQ 提取码: abq ...

  4. CentOS7下NFS服务安装及配置固定端口

    CentOS7下NFS服务安装及配置 系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1. ...

  5. CentOS下TFTP服务安装

    CentOS下TFTP服务安装 今天和同学做交换机恢复DCN操作系统的任务,然后需要用到tftp,然后就开始研究.这里对TFTP服务进行介绍以及安装. tftp 比 ftp 更易于管理 tftp 比 ...

  6. Linux下TFTP的安装,配置和操作

    注:转载他人,仅供自己研究学习使用 TFTP是用来下载远程文件的最简单网络协议,它其于UDP协议而实现.嵌入式linux的tftp开发环境包括两个方面:一是linux服务器端的tftp-server支 ...

  7. CentOS7下MySQL5.7安装配置方法图文教程(YUM)

    安装环境:CentOS7 64位,MySQL5.7 1.配置YUM源 在MySQL官网中下载YUM源rpm安装包:http://dev.mysql.com/downloads/repo/yum/ # ...

  8. Linux下DHCP服务安装配置

    简介 安装配置 一.简介 DHCP (Dynamic Host Configuration Protocol,动态主机管理协议)是一种基于UDP协议且仅限用于局域网的网络协议,主要用途是为局域网内部设 ...

  9. CentOS7下NFS服务安装及配置

    系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1.3.0-0.48.el7_4.x86_ ...

随机推荐

  1. Centos 配置jdk环境变量

    1.安装方法 windows 下载,复制到 linux,解压,配置环境变量 linux 使用 wget 下载,解压,配置环境变量 linux 使用 yum 直接安装,环境变量自动配置好 2.查看是否已 ...

  2. vscode 安装一些快捷配置

    Visual Studio Code 最好的功能.插件和设置   小编推荐:掘金是一个高质量的技术社区,从 ECMAScript 6 到 Vue.js,性能优化到开源类库,让你不错过前端开发的每一个技 ...

  3. [转] zookeeper 本地启动多节点

    1. zoo.cfg配置文件如下: # The number of milliseconds of each tick tickTime=2000 # The number of ticks that ...

  4. python在windows和linux下的安装和配置

    一.windows下安装python3.6 安装编辑器:Ecplise+pydev插件 Eclipse是写JAVA的IDE, 这样就可以通用了,学习代价小.  学会了Eclipse, 以后写Pytho ...

  5. mac 环境下mysql登陆失败问题Access denied for user 'root'@'localhost' (using passwordYES)

    1.停止mysql服务 sudo /usr/local/mysql/support-files/mysql.server stop 2.进入mysql的bin目录 cd /usr/local/mysq ...

  6. Class.getResources()和classLoader.getResources()区别

    Class.getResource(String path) path不以’/'开头时,默认是从此类所在的包下取资源: path 以’/'开头时,则是从ClassPath根下获取: package t ...

  7. 植物大战僵尸:寻找召唤僵尸关键CALL

    实验目标:通过遍历寻找召唤僵尸的CALL,通过调用CALL出现自定义的僵尸,加速僵尸的出现. 僵尸CALL的遍历技巧: 我们可以通过僵尸出现在屏幕中的个数来遍历寻找僵尸出现的CALL 首先打开CE-& ...

  8. 怎样理解在函数中声明var x = y = 1后调用函数时, x是局部变量, y是全局变量

    下面这段代码在执行的时候, 打印的结果是1, Error: undefined; function fn() { var x = y = 1; } fn(); console.log(y); // 1 ...

  9. javascript——HTML对象

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  10. JS 验证字符串是否能转为json格式

    var isJSON=function (str) { if (typeof str == 'string') { try { var obj = JSON.parse(str); if (typeo ...