如何将用户添加到“sudo”组?

Modified on: Sat, 09 Jun 2018 01:35:23 +0800

/etc/sudoers中我看到了:

# Allow members of group sudo to execute any command after they have
# provided their password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL

那么如何将用户添加到sudo组?

最佳答案

sudo usermod -aG sudo <username>

a非常重要。没有它,它们将从所有其他组中删除。您需要重新启动shell /终端或注销并重新登录才能使其生效。

另见:

作者:Community,maco

相关问答

添加新评论