这一行是我的Ubuntu 14.04
root ALL=(ALL:ALL) ALL
第三个ALL
的含义是什么?
上线和root ALL=(ALL) ALL
的区别是什么?
发布于 2014-11-06 04:55:27
虽然sudoers
命令页可能有点难以理解,但给出的一些示例可以帮助澄清一些事情:
dgb =(操作符) /bin/ls、(root) /bin/kill、/usr/bin/lprm --那时,用户
dgb
可以以operator
的形式运行/bin/ls
,而以root
的形式运行/bin/kill
和/usr/bin/lprm
。我们可以将其扩展为允许dgb
在用户或组设置为operator
的情况下运行/bin/ls
:dgb =(操作符: operator) /bin/ls、(root) /bin/kill、\ /usr/bin/lprm
我们可以推断,给定表单的sudoers
行:
A B = (C:D) E
D
是指可以使用的组。
因此,第三个ALL
指定用户可以在任何组下运行该命令。
如果指定了(ALL)
而不是(ALL:ALL)
,则该用户不能将sudo
与-g
一起用于这些命令:
Runas_Spec
A Runas_Spec determines the user and/or the group that a command may
be run as. ... The second defines a list of groups that
can be specified via `sudo`'s `-g` option. If both Runas_Lists are
specified, the command may be run with any combination of users and
groups listed in their respective Runas_Lists. If only the first is
specified, the command may be run as any user in the list but no `-g`
option may be specified.
(上面的例子来自同一节。)
发布于 2021-02-24 11:31:04
找到了一个有趣的文档
https://askubuntu.com/questions/546219
复制相似问题