Rsync不断要求密码,即使configuration了密码文件,可能是什么原因?

我在我的一台服务器上configuration了rsync ,configuration如下:

 [root@pnmpg4 ~]# cat /etc/rsyncd.conf max connections = 2 log file = /var/log/rsync.log timeout = 300 [hadoop_out] comment = hadoop_out path = /mass1/mt_data/hadoop_out read only = no list = yes uid = 502 gid = 502 auth users = syncuser secrets file = /etc/rsyncd.secrets hosts allow = XXXX 

xinetdpipe理rsync守护进程:

 [root@pnmpg4 ~]# cat /etc/xinetd.d/rsync # default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. service rsync { disable = no socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID } 

秘密文件只包含一行:

 user:password 

rsync秘密文件的权限是这样的:

 [root@pnmpg4 ~]# ls -ld /etc/rsyncd.secrets -rw------- 1 root root 18 2015-01-22 01:07 /etc/rsyncd.secrets 

当我运行一个rsync命令是这样的:

 rsync -raPv rsync://[email protected]/hadoop_out/*/*.complete . 

我不断要求input密码,我错过了什么? 这应该是一个自动的过程,不要求密码,你可以find这种行为的原因?

提前致谢,

secrets file是为了定义远程客户端需要提供的密码,以便连接到本地rsync守护程序,而不是用来指定连接客户端的密码。

在远程机器上,可以使用RSYNC_PASSWORD环境variables指定密码,也可以使用--password-file选项并将其存储在文件中。