将我的用户名添加到组 Wheel 时仍然不在 sudoers 文件中

MMM*_*VII 5 sudo

我已按照此说明进行操作

cchaney is not in the sudoers file . This incident will be reported.当我尝试测试它是否有效时,它仍然会给我警告。usermod -aG wheel cchaney但我已经在用户下执行了命令root。这是怎么回事???

tai*_*fwa 4

wheel本身需要允许相应地运行命令;还应该注意的是,wheel此类访问的使用取决于发行版/操作系统。macOS 和 Red Hat 使用它,Ubuntu 只是使用一个sudo组。

以 root 身份运行visudo并找到该wheel组。

如果文件中没有定义,则添加

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

并保存。如果您的用户已经登录,此时不需要注销wheel