Chinaunix

标题: 怎样才能在rsync客户端不输入密码就能直接运行(内详) [打印本页]

作者: babboyshi    时间: 2007-05-23 11:54
标题: 怎样才能在rsync客户端不输入密码就能直接运行(内详)
那么我的rsync 服务端rsyncd.conf设置
list = yes
uid = noboby
gid = noboby
read only = true
use chroot = no
transfer logging = true
hosts allow = 192.168.0.133/24
hosts deny = 192.168.0.0/24
max connections = 4
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
slp refresh = 300
#[Example]
#        path = /home/Example
#        comment = An Example
#        auth users = user
#        secrets file = /etc/rsyncd.secrets
[test]
path = /mnt/wwf
cmment = test
auth users = test
secrets file = /etc/rsyncd.secrets
/etc/rsyncd.secrets的设置是
test:821121  #这样编写的

客户端
/usr/sbin/rsyncd --daemon
rsync -a --progress test@192.168.0.86:/mnt/wwf  /mnt
输入以后会提示输入密码

客户端密码文件在/etc/rsyncd.secrets
test:821121  #这样编写的
rsync -a --progress  --password-file=/etc/rsyncd.secrets   test@192.168.0.86:/mnt/wwf  /mnt
可惜最后还是要提示密码
我想问怎样才能不用输入密码,因为我想自动备份.没有理由次次备份都要输入密码.我试过用标准输入解决,但是不成功.


并且我在系统新建了test这个帐号,密码是821121
我的客户端rsyncd.conf没有设置过

[ 本帖最后由 babboyshi 于 2007-5-23 12:00 编辑 ]
作者: babboyshi    时间: 2007-05-23 12:14
客户端的rsyncd.conf
gid = users

read only = true

use chroot = true

transfer logging = true

log format = %h %o %f %l %b

log file = /var/log/rsyncd.log

hosts allow = trusted.hosts

slp refresh = 300


#[Example]

#        path = /home/Example

#        comment = An Example

#        auth users = user

#        secrets file = /etc/rsyncd.secrets
作者: babboyshi    时间: 2007-05-24 00:11
唉!自己顶自己一下吧
作者: llzqq    时间: 2007-05-24 09:25
修改如下:

客户端密码文件在/etc/rsyncd.secrets
821121  #这样编写的
作者: babboyshi    时间: 2007-05-24 11:45
不行啊,究竟是什么原因
作者: babboyshi    时间: 2007-05-24 11:51
我的系统是SUSE Linux Enterprise Server 10
作者: 星期二    时间: 2007-05-24 15:53
rsync -a --progress  --password-file=/etc/rsyncd.secrets   test@192.168.0.86:/mnt/wwf  /mnt
改为
rsync -a --progress  --password-file=/etc/rsyncd.secrets   test@192.168.0.86::test /mnt/wwf  /mnt


加上test这个认证模块
作者: babboyshi    时间: 2007-05-24 16:31
原帖由 星期二 于 2007-5-24 15:53 发表于 7楼  
rsync -a --progress  --password-file=/etc/rsyncd.secrets   test@192.168.0.86:/mnt/wwf  /mnt
改为
rsync -a --progress  --password-file=/etc/rsyncd.secrets   test@192.168.0.86::test /mnt/wwf  /mn ...



不行啊,我试过了,还是需要输入密码.我的客户端/etc/rsyncd.secrets
821121 #试过
test:821121 #都试过
如果输入rsync -a --progress  --password-file=/etc/rsyncd.secrets   test@192.168.0.86::test  /mnt
就会显示的错误是代码是@ERROR:auth failed on module test rsync error:error starting client-server protocol (code 5) at
main.c (1183)

[ 本帖最后由 babboyshi 于 2007-5-24 16:33 编辑 ]
作者: 星期二    时间: 2007-05-24 16:42
ERROR:auth failed on module

chmod 600 /etc/rsyncd.secrets
作者: 星期二    时间: 2007-05-24 16:44
test:821121
是服务端的rsync.secrets
821121
是客户端的rsync.secrets


仔细检查
作者: babboyshi    时间: 2007-05-24 16:51
我都检查过了,但是都不成功,请问还有其它可能吗,我连防火强都关闭了
作者: 柳拂风    时间: 2007-05-25 08:51
你的 /etc/rsyncd.secrets 文件的属性是600吗?
作者: connet    时间: 2007-05-25 09:37
我测试下来 server 端 rsync.secrets 没用
passwd 中加用户test, group 与rsync.conf 一致
修改其密码。
client 使用 --password-file=/etc/rsyncd.secrets
作者: 水田青蛙    时间: 2007-05-25 10:39
host allow = IP
取消认证,客户端直接上去取,不是很方便么
作者: simonlm    时间: 2007-05-25 14:08
密码文件不是600的属性,是400的。
作者: babboyshi    时间: 2007-05-25 16:22
这样可以吗,我要回去试下才知道,我不在公司无法做试验
作者: babboyshi    时间: 2007-05-28 09:40
原帖由 connet 于 2007-5-25 09:37 发表于 13楼  
我测试下来 server 端 rsync.secrets 没用
passwd 中加用户test, group 与rsync.conf 一致
修改其密码。
client 使用 --password-file=/etc/rsyncd.secrets

具体怎样,你是说在rsync.conf那里修改密码,可是rsync.conf没有密码设置这个选项的
作者: babboyshi    时间: 2007-05-28 10:18
原帖由 simonlm 于 2007-5-25 14:08 发表于 15楼  
密码文件不是600的属性,是400的。

我刚刚试过了,都是不行.
作者: babboyshi    时间: 2007-05-28 10:24
现在出现一个新问题,就是客户端输入rsync -a --progress test@192.168.0.86::test /mnt/wwf         
再输入密码后会出现这个错误@ERROR:invalid uid noboby
如果我这样输入rsync -a --progress root@192.168.0.86:/mnt/wwf  /mnt/wwf
再输入我系统默认root账号密码就会正常运行.那么我的模块设置变得没有任何作用.
作者: babboyshi    时间: 2007-05-28 10:52
现在出现一个新问题,就是客户端输入rsync -a --progress test@192.168.0.86::test /mnt/wwf         
再输入密码后会出现这个错误@ERROR:invalid uid noboby
如果我这样输入rsync -a --progress root@192.168.0.86:/mnt/wwf  /mnt/wwf
再输入我系统默认root账号密码就会正常运行.那么我的模块设置变得没有任何作用.
作者: hill8000    时间: 2014-01-04 18:00
我也遇到同样的问题,提示输入密码的时候,其实验证的是建立的系统用户的密码,并没有直接验证建立的密码文件中的密码,也就是说如果把系统用户删除了,就没法传输了,坐等大神来帮忙




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2