rsyncd.conf - 正确设置gid参数

来源:互联网 发布:轩辕剑神骑进阶数据 编辑:程序博客网 时间:2024/06/05 06:24

rsyncd.conf - 正确设置gid参数

在rsyncd.conf文件中,模块中包括gid参数,通常在整个rsyncd.conf文件中使用相同的gid参数,值为nobody。也就是:

gid = nobody

如果阅读rsyncd.conf的帮助文档会看到如下说明:

# The "gid" option specifies the group name orgroup ID that file transfers to and from that module should take placeas when the daemon was run as root. This complements the "uid" option.The default is gid -2, which is normally the group "nobody".

译成中文如下:

# "gid"选项指定守护程序以root方式运行时模块应当替换的文件传入和传出的组名或组ID,配合"uid"选项。默认值是gid -2,也就是通常使用的"nobody"组。

文档中说明gid的默认值是-2,又说是nobody组。这个值来源于某些Linux的版本中gid是16位整数,在16位整数中,-2相当于无符号16位整数的65534,在该Linux版本中,gid为65534的组名是nobody。而现在很多Linux的版本中gid是32位整数,因此使用-2时将不能正确转换成65534。而且按照Linux标准:

http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/usernames.html

nobody组是可选的,不是必要的。也就是由Linux版本自行处理。例如CentOS中nobody组的gid值是99。因此,既使在rsyncd.conf中使用默认的gid取值,也应当显示的设置gid = nobody。
另外在很多rsyncd的文档中可以看到里面写成了gid = nogroup,用搜索引擎搜索“rsyncdnogroup”就能看到,但实际上nogroup组既不是Linux标准中的必要组,也不是可选组,仅在某些Linux版本中包含,因此为了避免歧义,也不应当创建名称为nogroup的组。

[rsync - 官方网站]

http://rsync.samba.org/

[rsync - 关键词]

rsync
rsyncd

[rsyncd.conf - 官方文档]

http://samba.org/ftp/rsync/rsyncd.conf.html

[rsync - 相关问题]

全局部分中常用全局参数配置说明

全局部分中常用模块参数配置说明

模块常用配置说明

认证相关参数配置说明

客户端常用参数

客户端其他参数

 

for Windows (cygwin)

远程shell模式和rsync守护进程模式

22.6. File Synchronization. Building Internet Firewalls, 2nd Edition

Hack 92 Mirroring Web Sites with wget and rsync. Spidering Hacks

Linux Security Cookbook - Recipe 1.16 Integrity Checking with rsync

Linux Security Cookbook - Recipe 1.6 Remote Integrity Checking

Linux Security Cookbook - Recipe 6.3 Copying Files Remotely

正确设置gid参数

--backup-dir 使用示例

hosts allow

hosts deny

gid

原创粉丝点击