注意,*代表具体的IP地址
基本环境:
rsync服务器配置如下:
cat /etc/rsyncd.conf
uid = root
gid = root
lock file = /var/run/rsyncd.lck
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
[mysql]
path = /backup/mysqldump/
comment = mysql directory
read only = true
list = false
auth users = root
secrets file = /etc/server.pas
客户端同步命令如下:
/usr/bin/rsync -avz --delete --password-file=/etc/18.pas /ftp/rsync/61.142.131.*/mysql
报错信息如下:
@ERROR: auth failed on module mysql
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)
查看rsync服务器端的日志文件有如下提示
2011/06/20 09:06:09 [7338] connect from dns2 (61.142.131.*)
2011/06/20 09:06:09 [7338] secrets file must not be other-accessible (see strict modes option)
2011/06/20 09:06:09 [7338] continuing without secrets file
2011/06/20 09:06:09 [7338] auth failed on module mysql from dns2 (61.142.131.*): missing secret for user "root"
经过仔细排查发现服务器端/etc/server.pas的密码文件权限不对,应为600,实为644,将该文件的权限更改为600后同步正常。
总结:服务器端的rsync的密码文件格式为username:password,权限为600
客户端密码文件格式为password,需同服务器端,权限为600,否则同 步会报错
阅读(1997) | 评论(0) | 转发(0) |