rsync 可以有用户特定的读写权限吗?

rsync 可以有用户特定的读写权限吗?

我正在研究使用 rsync 发布我正在从事的项目。但是,我遇到了一个问题——我需要使其公开可读,但不能公开可写(我不希望有人注入恶意内容并将其上传给任何试图获取更新的人)。我也想使用 rsync 上传任何更改,但我不知道如何限制特定用户的写权限。这可能吗?

如果有什么区别的话,我将使用 Windows 服务器。

答案1

rsyncd.conf 的手册页列出了一些可以与 rsync 守护进程一起使用的选项,其中包括:

read only
              This parameter determines whether clients will be able to upload files or
              not.  If  "read  only"  is  true then any attempted uploads will fail. If
              "read only" is false then uploads will be possible if file permissions on
              the  daemon  side  allow  them. The default is for all modules to be read
              only.

因此,请为要共享的目录设置一个模块,然后设置 rsync 守护进程,但将其设置为只读。更多详细信息这里

相关内容