rsync @ERROR: auth failed on module backup 解决思路及附录rsync常见问题及解决办法-程序员宅基地

技术标签: python  运维  操作系统  

昨晚小版本上线,使用rsync往服务器上传文件时,client报如下异常:

@ERROR: auth failed on module backup

rsync error: error starting client-server protocol (code 5) at main.c(1503) [Receiver=3.0.6]

首先:检查server端和client端的用户名和密码确认都无误;

         服务器端检查这个/etc/rsync.pass密码文件,

        注:其它系统可能密码文件名字不一样可以在配置文件中搜索cat /etc/rsyncd.conf | grep -i secrets 来确认密码文件的名字

               不建议用ps -ef | greep -i rsync 因为如果rsync被设置成守护进程启动的,进程只显示为xinetd,所以用ps的命令搜不到

然后:检查了服务器端/etc/rsyncd.conf 配置文件未发现异常, 

再次:通过配置文件找到了log存放目录

$ cat /etc/rsyncd.conf | grep -i log

log file = /var/log/rsync.log

查看/var/log/rsync.log发现

2017/07/21 09:38:33 [31746] name lookup failed for xxx.xx.xxx.xx: Name or service not known
2017/07/21 09:38:33 [31746] connect from UNKNOWN (xxx.xx.xxx.xx)
2017/07/21 09:38:33 [31746] auth failed on module ci from unknown (xxx.xx.xxx.xx): missing secret for user "pesdfk"

 google搜索一下,发现其它网友解决方案,在server的/etc/hosts里加上IP和主机名的映射,我没有采用该建议。因为这个系统一直是我在维护,上周还有版本上线

运行都正常。

主要还是围绕客户端的@ERROR: auth failed on module backup在猜想,肯定是用户验证出了异常。

又google了一下,看到有网友提示,server端rsync.pass文件的格式user:passwrod , 修改成user:passwrod后在client端重新上传文件正常。

奇怪的是之前一直都正常,而且rsync.pass上次修改日期是2016年。

 

附录:rsync常见问题及解决办法 (转载自:http://kkkkkk.blog.51cto.com/468162/1194202)

问题一:

@ERROR: chroot failed
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]

原因:
服务器端的目录不存在或无权限,创建目录并修正权限可解决问题。

 

问题二:
@ERROR: auth failed on module tee
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]

原因:
服务器端该模块(tee)需要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。
提供正确的用户名密码解决此问题。

 

问题三:
@ERROR: Unknown module ‘tee_nonexists’
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3]

原因:
服务器不存在指定模块。提供正确的模块名或在服务器端修改成你要的模块以解决问题。


问题四:
password file must not be other-accessible
continuing without password file
Password:
原因:
这是因为rsyncd.pwd rsyncd.secrets的权限不对,应该设置为600。如:chmod 600 rsyncd.pwd
问题五:
rsync: failed to connect to 218.107.243.2: No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
原因:
对方没开机、防火墙阻挡、通过的网络上有防火墙阻挡,都有可能。关闭防火墙,其实就是把tcp udp的873端口打开。 

问题六:
rsync error: error starting client-server protocol (code 5) at main.c(1524) [Receiver=3.0.7]
原因:
/etc/rsyncd.conf配置文件内容有错误。请正确核对配置文件。
问题七:
rsync: chown "" failed: Invalid argument (22)
原因:
权限无法复制。去掉同步权限的参数即可。(这种情况多见于Linux向Windows的时候)


问题八:
@ERROR: daemon security issue -- contact admin
rsync error: error starting client-server protocol (code 5) at main.c(1530) [sender=3.0.6]
原因:
同步的目录里面有软连接文件,需要服务器端的/etc/rsyncd.conf打开use chroot = yes。掠过软连接文件。


问题九:
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(747) [receiver=2.6.8]
rsync: connection unexpectedly closed (4 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
解决: 提示打开了read only,将配置文件 read only = no

问题十:
cat /var/log/rsyncd.log
2011/12/14 11:58:37 [22377] name lookup failed for XX.XX.XX.XX: Name or service not known
2011/12/14 11:58:37 [22377] connect from UNKNOWN (XX.XX.XX.XX)
2011/12/14 11:58:37 [22377] rsync to html/ from unknown (XX.XX.XX.XX)
解决:需要在服务端这台机上上的/etc/hosts里面添加客户端机的ip和机器名

问题十一: 

[root@Dell-R710 ~]# rsync -artuz -R --delete ./ 192.168.1.233::gex
rsync: failed to connect to 61.145.118.206: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(124) [sender=3.0.6]
解决:
一、查看防火墙
二、查看服务端是否开启守护进程
ps ax|grep rsync
rsync --daemon --config=/etc/rsyncd.conf

#####################################################################

 

问题1:
在client上遇到问题:
rsync -auzv --progress --password-file=/etc/rsync.pas [email protected]::backup /home/
rsync: could not open password file "/etc/rsync.pas": No such file or directory (2)
Password: 
@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]

遇到这个问题:client端没有设置/etc/rsync.pas这个文件,而在使用rsync命令的时候,加了这个参数--
password-file=/etc/rsync.pas

问题2:
rsync -auzv --progress --password-file=/etc/rsync.pas [email protected]::backup /home/
@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]
遇到这个问题:client端已经设置/etc/rsync.pas这个文件,里面也设置了密码111111,和服务器一致,但是
服务器段设置有错误,服务器端应该设置/etc/rsync.pas  ,里面内容root:111111 ,这里登陆名不可缺少

问题3:
rsync -auzv --progress --password-file=/etc/rsync.pas [email protected]::backup /home/
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]

遇到这个问题,是因为服务器端的/home/backup  其中backup这个目录并没有设置,所以提示:chdir failed

问题4:
rsync: write failed on "/home/backup2010/wensong": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]
rsync: connection unexpectedly closed (2721 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]
磁盘空间不够,所以无法操作。
可以通过df /home/backup2010 来查看可用空间和已用空间

问题5:网络收集问题
1、权限问题
类似如下的提示:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的目录权限是否为755
2、time out
rsync: failed to connect to 203.100.192.66: Connection timed out (110)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]
检查服务器的端口netstat –tunlp,远程telnet测试。


3、服务未启动
rsync: failed to connect to 10.10.10.170: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]
启动服务:rsync --daemon --config=/etc/rsyncd.conf


4、磁盘空间满
rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28)
*** Skipping any contents from this failed directory ***


5、Ctrl+C或者大量文件
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [receiver=3.0.5]
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [generator=3.0.5]


6、xnetid启动
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(759) [receiver=3.0.5]
查看rsync日志
rsync: unable to open configuration file "/etc/rsyncd.conf": No such file or directory
xnetid查找的配置文件位置默认是/etc下,根据具体情况创建软链接。例如:
ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf
或者更改指定默认的配置文件路径,在/etc/xinetd.d/rsync配置文件中

 

转载于:https://www.cnblogs.com/reve-wang/p/7216582.html

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_30293135/article/details/99398894

智能推荐

字符,字节和编码-程序员宅基地

文章浏览阅读39次。级别:中级摘要:本文介绍了字符与编码的发展过程,相关概念的正确理解。举例说明了一些实际应用中,编码的实现方法。然后,本文讲述了通常对字符与编码的几种误解,由于这些误解而导致乱码产生的原因,以及消除乱码的办法。本文的内容涵盖了“中文问题”,“乱码问题”。掌握编码问题的关键是正确地理解相关概念,编码所涉及的技术其实是很简单的。因此,阅读本文时需要慢读多想,多思考。引言“字符与编码”...

Linux 修改 ELF 解决 glibc 兼容性问题_glibc_private-程序员宅基地

文章浏览阅读1.1k次。Linux glibc 问题相信有不少 Linux 用户都碰到过运行第三方(非系统自带软件源)发布的程序时的 glibc 兼容性问题,这一般是由于当前 Linux 系统上的 GNU C 库(glibc)版本比较老导致的,例如我在 CentOS 6 64 位系统上运行某第三方闭源软件时会报:[root@centos6-dev ~]# ldd tester./tester: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by._glibc_private

wxWidgets:常用表达式_wxwidget 正则表达式 非数字字符-程序员宅基地

文章浏览阅读282次。wxWidgets:常用表达式wxWidgets:常用表达式不同风味的正则表达式转义Escapes元语法匹配限制和兼容性基本正则表达式正则表达式字符名称wxWidgets:常用表达式一个正则表达式描述字符的字符串。这是一种匹配某些字符串但不匹配其他字符串的模式。不同风味的正则表达式POSIX 定义的正则表达式 (RE) 有两种形式:扩展正则表达式(ERE) 和基本正则表达式(BRE)。ERE 大致是传统egrep 的那些,而 BRE 大致是传统ed 的那些。这个实现增加了第三种风格:高级正则表达式_wxwidget 正则表达式 非数字字符

Java中普通for循环和增强for循环的对比_for循环10万数据需要时间-程序员宅基地

文章浏览阅读3.4k次,点赞5次,收藏11次。Java中普通for循环和增强for循环的对比_for循环10万数据需要时间

学习PCB设计前的知识扫盲_pcb端子设计基础知识-程序员宅基地

文章浏览阅读2.7k次,点赞13次,收藏97次。0.工厂制作PCB线路板流程1.PCB的结构铜层阻焊丝印本质(PCB画电路板到底在画什么)基础工艺指标2.PCB图中的元素元素布局布线叠层设计3.PCB的设计依据原理图原理图元件库4.PCB的设计流程——总结_pcb端子设计基础知识

Python读取Excel内容;将读取的数据转换为list类型便于切片处理;列表的操作方法;pandas处理DataFrame类型数据;pandas操作;Python几种取整的方法_pandas excel list-程序员宅基地

文章浏览阅读4.5k次,点赞5次,收藏19次。Python读取Excel内容;将读取的数据转换为list类型便于切片处理;列表的操作方法;pandas处理DataFrame类型数据_pandas excel list

随便推点

Linux 开发环境工具[zt]-程序员宅基地

文章浏览阅读120次。软件集成开发环境(代码编辑、浏览、编译、调试)Emacs http://www.gnu.org/software/emacs/Source-Navigator 5.2b2 http://sourceforge.net/projects/sourcenavAnjuta http://anjuta.sourceforge...._linux上安装flawfinder

java小易——Spring_spring的beanfactory是hashmap吗-程序员宅基地

文章浏览阅读109次。SpringIoC DI AOPspring底层用的是ConcurrentHashMap解耦合:工厂模式:需要一个模板控制反转 IoC将原来有动作发起者(Main)控制创建对象的行为改成由中间的工厂来创建对象的行为的过程叫做IoC一个类与工厂之间如果Ioc以后,这个时候,动作发起者(Main)已经不能明确的知道自己获得到的对象,是不是自己想要的对象了,因为这个对象的创建的权利与交给我这个对象的权利全部转移到了工厂上了所用包:DOM4j解析XML文件lazy-init = _spring的beanfactory是hashmap吗

温故而知新:部分常见的图像数学运算处理算法的用途_图像处理算啊-程序员宅基地

文章浏览阅读1.3k次,点赞29次,收藏24次。本文将图像处理中常用的数学运算算法及其对图像的作用做了个汇总介绍,有助于图像处理时针对对应场景快速选择合适的数学算法。_图像处理算啊

EM Agent Fatal agent error: State Manager failed at Startup_check agent status retcode=1-程序员宅基地

文章浏览阅读1.1k次。EM 不定期异常宕机,问题重复出现,之前几次因为忙于其它事,无力兼顾,等回头处理时,发现EM已恢复正常。这次问题又重现,准备彻底解决,过程如下:1. 重新启动EM失败,报错:/u01/oracle/agent/core/12.1.0.5.0/bin/emctl status agentOracle Enterprise Manager Cloud Control 12c Relea_check agent status retcode=1

JVM常用调优参数 ——JVM篇_jvm调优-程序员宅基地

文章浏览阅读1.9w次,点赞50次,收藏366次。JVM常用性能调优参数详解​ 在学习完整个JVM内容后,其实目标不仅是学习了解整个JVM的基础知识,而是为了进行JVM性能调优做准备,所以以下的内容就是来说说JVM性能调优的知识。一、性能调优​ 性能调优包含多个层次,比如:架构调优、代码调优、JVM调优、数据库调优、操作系统调优等等。​ 架构调优和代码调优是JVM调优的基础,其中架构调优是对系统影响最大的。性能调优基本上按照以下步骤进行:明确优化目标发现性能瓶颈性能调优通过监控及数据统计工具获得数据确认是否达到目标二、何时进_jvm调优

三级嵌入式准备(二)_八个gpio引脚最多构成几个按键-程序员宅基地

文章浏览阅读435次,点赞3次,收藏7次。转载来源为https://blog.csdn.net/ReCclay/article/details/79439686 1、嵌入式系统的CPU主要使用的有DSP、ARM以及FPGA。2、DSP适用于数字信号处理的微处理器支持单指令多数据(DIMD)并行处理的指令显著提高音频、视频等数字信号的数据处理效率3、片上系统SOC已成为嵌入式处理器芯片的主流发展趋势它是..._八个gpio引脚最多构成几个按键