配置匿名rsync守护程序

编辑:我发现通过在根目录中使用一个文件夹,事情变得更进一步 – 我可以列出子文件.所以它真的看起来像文件夹上的权限是问题.除了chmod 777,我不确定还能做什么.

我正在尝试在CentOS 5.9上配置匿名rsync守护程序.

如果我允许chroot服务器报告chroot失败.如果我禁用它,chdir会失败.

# rsyncd.conf

max connections = 20
log file = /var/log/rsync.log
timeout = 300
use chroot = false

[builds]
    path = /home/fuzz/builds
    read only = yes
    list = yes
    uid = nobody
    gid = nobody

.

# /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
}

我已将/ home / fuzz / builds下的所有文件和文件夹设置为777.该文件夹由用户fuzz拥有.

在客户端,这工作……

$rsync rsync://host
builds

但是当我尝试查看builds目录的内容时,我收到此错误…

$rsync -vvvv rsync://host/builds
opening tcp connection to host port 873
Connected to host (10.186.5.90)
note: iconv_open("UTF-8", "UTF-8") succeeded.
sending daemon args: --server --sender -vvvvde.Lsf . builds/
@ERROR: chdir failed
[Receiver] _exit_cleanup(code=5, file=main.c, line=1534): entered
rsync error: error starting client-server protocol (code 5) at main.c(1534) [Receiver=3.0.9]
[Receiver] _exit_cleanup(code=5, file=main.c, line=1534): about to call exit(5)
最佳答案
通常,这表明存在某种许可问题.如果您已经检查了/ home / fuzz和/ home / fuzz / builds的权限,我的下一个怀疑是selinux.您可以检查selinux是否启用了getenforce.要暂时禁用它以确定是否存在问题,请运行setenforce 0

转载注明原文:配置匿名rsync守护程序 - 代码日志