User is not in the sudoers file in CentOS
I got this above error while trying to do sudo user. see Image – 1
CentOS 6 does not add users to sudoers by default and nor does it allow group wheel sudo access.
How to configure it manually
Login with root user or type su – then type root user password.
open vi etc/sudoers
Add your userid to the list or uncomment the lines allowing group wheel
If you uncomment the wheel lines then you need to add your userid to the group using
e.g. usermod -a -G wheel myuser then logout and back in again to pick up the new group membership.
See the Image – 2 for better understanding.
Reference – https://serverfault.com/questions/854623/centos-7-adding-a-user-to-sudoers-group-still-is-not-in-the-sudoers-file-w
You may also like:-