所以我有一个用户运行sudo,他们在wheel和other_group。 other_group不应该需要密码,但轮子。 我的问题是:轮需要sudo密码否定other_group不需要密码的事实吗?
inheritance人sudo visudo一个片段:
## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL ## Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL ## Allows members of the users group to mount and unmount the ## cdrom as root # %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom ## Allows members of the users group to shutdown this system # %users localhost=/sbin/shutdown -h now %other_group ALL=(ALL) NOPASSWD: ALL
通常,最后一场比赛赢得sudo。 从sudoers手册页
当多个条目匹配用户时,它们按顺序应用。 如果有多个匹配,则使用最后的匹配(不一定是最具体的匹配)。
你确定用户是在两个组?
在Centos系统上,我必须按预期交付这个工程
%wheel ALL=(ALL) ALL %other_group ALL=(ALL) NOPASSWD: ALL
不需要密码,因为other_group是后轮。
%other_group ALL=(ALL) NOPASSWD: ALL %wheel ALL=(ALL) ALL
轮子在other_group之后请求密码。