0

On a CentOS 7 server, a user is added to the wheel group, but then that same user is not able to run sudo commands.

What specific commands need to be added to the below in order for the user named wannabe_sudoer_user to be allowed to run sudo commands?


The Specifics:

Here is the terminal log that shows the failed attempt to add the wannabe_sudoer_user user to the sudoers list:

[wannabe_sudoer_user@localhost ~]$ su -
Password:
Last login: Mon May 15 13:58:21 PDT 2017 on ttyS0
[root@localhost ~]# gpasswd -a wannabe_sudoer_user wheel
Adding user wannabe_sudoer_user to group wheel
[root@localhost ~]# exit
logout
[wannabe_sudoer_user@localhost ~]$ sudo mkdir /opt/atlassian/

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for wannabe_sudoer_user:
wannabe_sudoer_user is not in the sudoers file.  This incident will be reported.
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
CodeMed
  • 5,199

1 Answers1

3

After a quick glance I would say your session in the above example does not KNOW that your user has been added to "wheel". I would close the session (logout), start a new session (login, open a new terminal, etc.) and try again.

0xSheepdog
  • 2,750