免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 18037 | 回复: 10

关于rsync的问题。。。怎么都通不了。奇怪了! [复制链接]

论坛徽章:
0
发表于 2011-06-20 17:45 |显示全部楼层
出现的错误如下:

[root@qihua bin]# vi /usr/bin/rsyncd.sh
#!/bin/sh
#linux bakup
/usr/bin/rsync -avzP -delete -e ssh --password-file=/etc/rsyncd.scrt root@192.168.1.14::zuopin /mnt/data/
~
~
[root@qihua bin]# rsyncd.sh
@ERROR: auth failed on module zuopin
rsync error: error starting client-server protocol (code 5) at main.c(1296) [receiver=2.6.8]

具体配置如下:
一:
192.168.1.14上的rsyncd.conf:
[global]
secrets file = /etc/rsyncd.scrt
strict modes = yes
port = 873
logfile = /var/log/rsyncd.log
pidfile = /var/run/rsyncd.pid
max connections = 4
[zuopin]
uid = root
gid = root
path = /material/zuopin/
read only = yes
hosts allow = 192.168.1.20
auth users = root

二:
192.168.1.14和192.168.1.20 有一个共同的rsyncd.scrt:
guest:rsync

三:
192.168.1.14上/var/log/rsyncd.log下的日志都是这样的:
2011/06/20 16:42:21 [17732] name lookup failed for 192.168.1.20: Name or service not known
2011/06/20 16:42:21 [17732] connect from UNKNOWN (192.168.1.20)
2011/06/20 16:42:21 [17732] rsync allowed access on module zuopin from unknown (192.168.1.20)
2011/06/20 16:42:21 [17732] auth failed on module zuopin from unknown (192.168.1.20): missing secret for user "root"


但是:

如果把rsyncd.sh 改成:
#!/bin/sh
#linux bakup
/usr/bin/rsync -avzP -delete -e ssh --password-file=/etc/rsyncd.scrt root@192.168.1.14:/material/zuopin /mnt/data/

就可以了显示如下:
[root@qihua ~]# rsyncd.sh
receiving file list ...
209036 files to consider
......
请高手给看看是咋回事吧,我觉得一定是出在这个root@192.168.1.14::zuopin 。但是具体咋回事也不太懂! thanks !

论坛徽章:
0
发表于 2011-06-20 20:23 |显示全部楼层
奇怪哦,我记得只要写对应模块的[]里就就能同步了

论坛徽章:
0
发表于 2011-06-20 20:30 |显示全部楼层
就看我上面写的这些哪里有什么问题吗?似乎那个模块没起作用。

论坛徽章:
0
发表于 2011-06-20 20:50 |显示全部楼层
回复 3# shineregion


对比 网上配置资料  仔细看你配置的对吗

论坛徽章:
0
发表于 2011-06-20 22:51 |显示全部楼层
192.168.1.14和192.168.1.20 有一个共同的rsyncd.scrt:
guest:rsync


客户端的密码文件内只能有密码,不应该有用户名。

并且两个密码文件的权限都要设置成600

论坛徽章:
0
发表于 2011-06-21 09:47 |显示全部楼层
改过了也不行,我上面的配置,直接用root用户做,可以的吧?

论坛徽章:
0
发表于 2011-06-21 12:08 |显示全部楼层
搞定了,是rsync.scrt里面的用户名设错了!我倒!

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
发表于 2011-06-21 12:50 |显示全部楼层

论坛徽章:
0
发表于 2011-06-21 13:37 |显示全部楼层
snow888 发表于 2011-06-21 12:50



    其实不是我大意设错的,是我本来真的没意识到这些,没有弄懂每个字节的意思!基础知识欠缺!法王见笑了!

论坛徽章:
0
发表于 2011-06-21 13:53 |显示全部楼层
请高手给看看是咋回事吧,我觉得一定是出在这个root@192.168.1.14::zuopin 。但是具体咋回事也不太懂! thanks !
shineregion 发表于 2011-06-21 13:37



    不知道你从哪里看到rsync要用2个冒号的, 1个冒号是对的

rsync -avz -e ssh user@remoteip:path/file localpath/
rsync -avz -e ssh localpath/file user@remoteip:path/
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP