我尝试通过键入 向 CentOS 7 devbox 用户授予 sudo 权限gpasswd -a user wheel
,但尝试失败。我究竟做错了什么?
这是我输入的内容:
我发现该用户不在wheel组中,如下:
[user@localhost git]$ sudo yum install git
[sudo] password for user:
Sorry, try again.
[sudo] password for user:
Sorry, try again.
[sudo] password for user:
user is not in the sudoers file. This incident will be reported.
Run Code Online (Sandbox Code Playgroud)
然后,我以 root 身份登录并输入以下命令将用户添加到wheel组:
[user@localhost git]$ su -
Password:
Last login: Thu Aug 20 17:11:31 PDT 2015 on pts/0
[root@localhost ~]# gpasswd -a user wheel
Adding user user to group …
Run Code Online (Sandbox Code Playgroud)