使用rsync往服务器上传文件时,client报如下异常:
@ERROR: auth failed on module XXX rsync error: error starting client-server protocol (code 5) at main.c(1503) [Receiver=3.0.6]
检查server端和client端的用户名和密码确认都无误;
/etc/rsync.pass
密码文件--password-file
配置的密码文件检查server端rsync日志
@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
错误信息:
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::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]
解决方案:
/etc/rsync.pas
文件,或者修改命令中的文件路径为正确的密码文件路径。错误信息:
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::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]
解决方案:
/etc/rsync.pas
内容为 root:111111
。错误信息:
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/ @ERROR: chdir failed rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]
解决方案:
/home/backup
目录是否存在。错误信息:
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
查看可用空间。权限问题:
rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)
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
测试。服务未启动:
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
磁盘空间满:
rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28) *** Skipping any contents from this failed directory ***
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]
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: unable to open configuration file "/etc/rsyncd.conf": No such file or directory
bashln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf
或者在 /etc/xinetd.d/rsync
配置文件中指定默认的配置文件路径。本文作者:GYC
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!