rsyncd.conf - 正确设置gid参数

本文解析了rsyncd.conf中gid参数的正确配置方法。详细解释了为何应当显式设置gid=nobody而非使用默认值-2,并指出使用nogroup可能带来的问题。

rsyncd.conf - 正确设置gid参数

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

gid = nobody

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

# The "gid" option specifies the group name or group ID that file transfers to and from that module should take place as 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,用搜索引擎搜索“rsyncd nogroup”就能看到,但实际上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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值