即使配置了机密文件,Rsync 仍然要求输入密码,可能是什么原因?

Ita*_*not 3 rsync

我已经rsync在我的一台服务器上进行了配置,配置如下所示:

[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 = X.X.X.X
Run Code Online (Sandbox Code Playgroud)

xinetd管理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
}
Run Code Online (Sandbox Code Playgroud)

secrets 文件只包含一行:

user:password
Run Code Online (Sandbox Code Playgroud)

rsync secrets 文件的权限是这样的:

[root@pnmpg4 ~]# ls -ld /etc/rsyncd.secrets 
-rw------- 1 root root 18 2015-01-22 01:07 /etc/rsyncd.secrets
Run Code Online (Sandbox Code Playgroud)

当我运行这样的rsync命令时:

rsync -raPv rsync://syncuser@X.X.20.18/hadoop_out/*/*.complete .
Run Code Online (Sandbox Code Playgroud)

我一直被要求输入密码,我错过了什么?这应该是一个不需要密码的自动过程,你能找到这种行为的原因吗?

提前致谢,

Sve*_*ven 6

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

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