Add User to Sudoers Group in CentOS

Categories:

Using root user is not recommended. To allow users to behave like root you can add them to the sudoers group. For CentOS, this group is called wheel. Strange, isn’t it? Why not sudo? Well, it’s wheel and that’s it.

To add the user to the sudoers group (as root)

usermod -aG wheel username

If it doesn’t work yet, edit the /etc/sudoers file (as root) using visudo

visudo

Uncomment this line (there should be two similar lines for wheel, make sure to uncomment this one and not the other one). Remove the # if it is there (do not remove the %)

%wheel ALL=(ALL) ALL

You can sudo now!

Leave a Reply

Your email address will not be published. Required fields are marked *