尽管用户属于轮组,但“用户不在 sudoers 文件中”

rho*_*nan 2 linux root users sudo

我已经向组中添加了一个新用户wheel。我可以使用此用户和密码 ssh 进入机器并确认它属于该组:

[newuser@xxx.xxx ~]$ groups
newuser wheel
Run Code Online (Sandbox Code Playgroud)

但是,如果我尝试使用 root 权限运行任何东西:

[newuser@xxx.xxx ~]$ sudo ls -lt /root
[sudo] password for newuser:
newuser is not in the sudoers file.  This incident will be reported.
Run Code Online (Sandbox Code Playgroud)

visudo确认组中的用户wheel应具有以下权限:

## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL
Run Code Online (Sandbox Code Playgroud)

所有教程都说将用户添加到该组就足够了。我还需要做什么?

PS:这是一个amazon-linux机器

Ger*_*der 9

wheelsudoers 文件中的条目已被注释掉,因此该组wheel根本没有 sudo 访问权限。

#从行中删除:

%wheel        ALL=(ALL)       ALL
Run Code Online (Sandbox Code Playgroud)