免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 8853 | 回复: 18
打印 上一主题 下一主题

rsync同步备份急需解决办法 [复制链接]

论坛徽章:
0
跳转到指定楼层
[收藏(0)] [报告]
发表于 2008-06-20 17:47 |只看该作者 |正序浏览
10可用积分
uid = root       
gid = root
use chroot = no         
max connections = 4         
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log   

[backup]            
path = /home
comment = BACKUP CLIENT IS SOLARIS 8 E250
ignore errors            
read only = yes            
list = no            
auth users = root        
secrets file = /etc/rsyncd.pas   


[root@HBC ~]# cat /etc/rsyncd.pas
root:password

客户端
[root@hbc ~]# rsync -vzrtopg --progress --delete backup@192.168.1.55::backup
Password:
@ERROR: auth failed on module backup
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)


服务端的错误日志
nore errors
2008/06/20 18:26:48 [3483] name lookup failed for 192.168.1.56: Name or service not known
2008/06/20 18:26:50 [3483] auth failed on module backup from UNKNOWN (192.168.1.56)

请问高手如何解决~!!!着急~!!


按照楼下的帮助改变后
uid = root
gid = root
use chroot = no
max connections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[root]
path = /home
comment = BACKUP CLIENT IS SOLARIS 8 E250
ignore errors
read only = yes
list = no
auth users = root
secrets file = /etc/rsyncd.pas

rsync -vzrtopg --progress --delete root@192.168.1.55::root  /root/path

客户端
@ERROR: auth failed on module root
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)


服务端日志

2008/06/23 09:38:03 [3130] secrets file must not be other-accessible (see strict modes option)
2008/06/23 09:38:03 [3130] continuing without secrets file
2008/06/23 09:38:03 [3130] auth failed on module root from UNKNOWN (192.168.1.56)


本人新手 谢谢大家指导,或者大家提供我一个简单的方法也行 谢谢了

[ 本帖最后由 1330313150 于 2008-6-23 09:25 编辑 ]

论坛徽章:
0
18 [报告]
发表于 2010-12-14 14:01 |只看该作者
配的乱七八糟的
明明 auth users = root
为什么要用  这样能验证成功才见鬼呢
你到底是要用root用户还是 ...
real_lufeng 发表于 2008-06-20 17:47



直戳软肋 够狠 哈哈

论坛徽章:
0
17 [报告]
发表于 2010-12-13 22:10 |只看该作者
回复 17# 1330313150

--password-file=/root/rsync.pass密码文件的内容呢??

论坛徽章:
0
16 [报告]
发表于 2008-06-25 14:53 |只看该作者
uid = root
gid = root
use chroot = no
max connections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[backup]
path = /home
comment = BACKUP CLIENT IS SOLARIS 8 E250
read only = yes
list = no
auth users = root
secrets file = /etc/rsync.passwd

vi rsync.passwd
rsync:admin99
chmod 600 rsyncd.passwd

客户机
vi rsync.passwd
admin99
chmod 600 rsync.passwd
rsync -vzrtopglq --size-only --progress --delete --password-file=/root/rsync.passwd rsync@192.168.1.55::backup /home

@ERROR: auth failed on module backup
rsync: connection unexpectedly closed (90 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)

怎么解决?

论坛徽章:
0
15 [报告]
发表于 2008-06-24 12:46 |只看该作者
原帖由 1330313150 于 2008-6-23 15:16 发表
我现在已然有点乱了。。。
希望有人能指点下,或者说是给我一下你们大家做这个的时候的配置让我参考下,不要粘贴复制。谢谢

一个冒号是 rsh/ssh 连接的
两个冒号是 rsync 自己的连接

论坛徽章:
0
14 [报告]
发表于 2008-06-24 12:20 |只看该作者
加我qq我帮你做 981853946
看不下去了

论坛徽章:
0
13 [报告]
发表于 2008-06-24 10:47 |只看该作者
原帖由 luo118 于 2008-6-20 19:34 发表
auth failed on module backup from UNKNOWN
找不你定义的 backup 模块
            
path = /home
comment = BACKUP CLIENT IS SOLARIS 8 E250
ignore errors            
read only = yes            ...




按照你说的我都改了,可是还是出同样的错误~!

论坛徽章:
0
12 [报告]
发表于 2008-06-24 10:34 |只看该作者
哦 我明白你的意思~!

论坛徽章:
0
11 [报告]
发表于 2008-06-23 19:04 |只看该作者
你给出的例子是把rsync当作daemon运行的,不过这种我没做过。
如果是一般命令行的话。
先要建立ssh安全通道,就不用输入密码了,方法如下:
在host1 以user1登陆:

$ssh-keygen -t dsa

连续回车,(默认),不用cypher



在$HOME/.ssh下生成 id_dsa  id_dsa.pub



在host2上以user2登陆:

同样的动作。


然后在host2上 user2的$HOME里 执行
# cp id_dsa.pub authorized_keys   (若是老版本的ssh,可能要用authorized_keys2的文件名)

将host1上的id_dsa.pub重命名host1.pub 拷贝到host2 user2$HOME的.ssh下

然后执行
cat host1.pub >> authorized_keys   

这样就可以从host1用user1登陆host2而不用密码
user1@host1 $ ssh user2@host2

不过ssh版本不能太老。

然后就是rsync的设置。用楼上几位的设置就可以了

论坛徽章:
0
10 [报告]
发表于 2008-06-23 15:16 |只看该作者
我现在已然有点乱了。。。
希望有人能指点下,或者说是给我一下你们大家做这个的时候的配置让我参考下,不要粘贴复制。谢谢

论坛徽章:
0
9 [报告]
发表于 2008-06-23 14:44 |只看该作者
原帖由 1330313150 于 2008-6-23 09:31 发表





[root@hbc ~]# rsync -vzrtopg --delete  -e ssh ftpuser@192.168.1.55:/home/ /home/
The authenticity of host '192.168.1.55 (192.168.1.55)' can't be established.
RSA key fingerprint is c ...



密码认证失败
  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP