大网数据广告活动
服务器运维问答

Rsync keeps asking for password even though a secrets file is configured, what could be the reason?

· 52CE 我爱测

I've configured rsync on one of my servers, the configuration looks like that: [root@pnmpg4 ~]# cat /etc/rsyncd.conf max connections = 2 log file = /var/log/rsync.log timeout = 300 [hadoop_out] comment = hadoop_out path = /mass1/…

问题原文

原帖链接 · Itai Ganot · CC BY-SA 3.0

I've configured rsync on one of my servers, the configuration looks like that:

[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

xinetd manages the rsync daemon:

[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
}

The secrets file includes only one line:

user:password

rsync secrets file permissions is like so:

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

When I run a rsync command like so:

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

I keep getting asked to enter a password, what am I missing? this is supposed to be an automatic process which doesn't ask for a password, can you find the reason for this behavior?

Thanks in advance,

已采纳解答

原帖链接 · Sven · CC BY-SA 3.0

The secrets file is meant to define a password that remote clients need to supply in order to connect to the local rsync daemon, it is not used to specify a password for the connecting client.

On the remote machine, you can either use the RSYNC_PASSWORD environment variable to specify the password or use the --password-file option and store it in a file.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-01-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。