红联Linux门户
Linux帮助

rsync服务器同步出错求助

发布时间:2010-02-13 12:33:36来源:红联作者:szfhx
[i=s] 本帖最后由 szfhx 于 2010-2-21 15:59 编辑 [/i]

我的ubuntu服务器(192.168.2.99)用rsync备份目录到本地可以,如:
su
rsync -avz --delete --exclude-from="/home/hr/back/paicu" /home /back/
其中:服务器和客户端都创建hr和fhx用户

在客户端192.168.2.8输入命令:
su #在root或hr或fhx用户中使用下面命令出错提示都一样,好像在客户端建的密码文件也没用
rsync -avz --password-file=/etc/rsyncd.scrt hr@192.168.2.99::homehr /home/hr
rsync -avz --password-file=/etc/rsyncd.scrt fhx@192.168.2.99::homehr /home/fhx
显示错误如下:
password file must not be other-accessible
continuing without password file
Password:
@ERROR: auth failed on module homehr
rsync error: error starting client-server protocol (code 5) at main.c(1521) [receiver=3.0.6]

但用以下命令则可以:
rsync -avz hr@192.168.2.99:/home /home/hr
难道ubuntu rsync使用::homehr (模块名)不行吗? --password-file=/etc/rsyncd.scrt 密码文件设置(免密码输入的设置)也不行吗?
请教各位高手解决?


附我的192.168.2.99服务器端rsync设置:
su
vim /etc/rsyncd.conf
#[globale]
strict modes= yes
#check passwd file
port= 873
#default port
logfile= /var/log/rsyncd.log
pidfile= /var/run/rsyncd.pid
max connections= 4
#[modules]
[homehr]
#备份模块
uid= root
gid= root
path= /home
#要备份的目录
read only= no
host allow=192.168.2.8
auth users= hr,fhx
secrets file= /etc/rsyncd.scrt


密码文件:
vim /etc/rsyncd.scrt
hr:123
fhx:123
chmod 600 /etc/rsyncd.scrt

启动服务(如开有防火墙请允许873端口通过)
rsync --daemon --config=/etc/rsyncd.conf

配置客户端(192.168.2.8)rsync ubuntu默认已安装
新建或修改密码文件
su
vim /etc/rsyncd.scrt
文件内容与客户端文件内容一样
chmod 600 /etc/rsyncd.scrt
文章评论

共有 0 条评论