我使用 visudo 命令编辑 /etc/sudoers,以便授予用户无需密码的 sudo 权限,如下所示:
userName ALL=(ALL:ALL) NOPASSWD:ALL
但它对我不起作用,
任何建议提前致谢
答案1
确保所提及的规则之下没有规则覆盖该规则。来自man sudoers
(1.7.2p2):
When multiple entries match for a user, they are applied in order.
Where there are multiple matches, the last match is used (which is not
necessarily the most specific match).
答案2
尝试
userName ALL = NOPASSWD: ALL