这一行来自我的 Ubuntu 14.04
root ALL=(ALL:ALL) ALL
Run Code Online (Sandbox Code Playgroud)
第三个是什么意思ALL?
上面那行和 有root ALL=(ALL) ALL什么区别?
虽然sudoers联机帮助页可能有点令人兴奋,但给出的示例有助于澄清问题:
Run Code Online (Sandbox Code Playgroud)dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm然后用户
dgb现在被允许运行/bin/lsasoperator, but/bin/kill和/usr/bin/lprmasroot。我们可以扩展这个允许
dgb运行/bin/ls与用户或组设置为operator:Run Code Online (Sandbox Code Playgroud)dgb boulder = (operator : operator) /bin/ls, (root) /bin/kill,\ /usr/bin/lprm
我们可以推断出,给定sudoers一行形式:
A B = (C:D) E
Run Code Online (Sandbox Code Playgroud)
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.
Run Code Online (Sandbox Code Playgroud)
(以上示例来自同一部分。)
| 归档时间: |
|
| 查看次数: |
8842 次 |
| 最近记录: |