Add user to Sudoers Group CentOS

Add user to Sudoers Group CentOS

from time to time normal users need to have root permissions for security reasons, or of root password is forgotten, etc

login as root (that’s the catch)

install sudo if it is not installed (version 6 and higher it is not by default)

from here we need to edit the sudoers file using “visudo”

scroll down to this line

add the username you want to give sudo permissions to in the same format as root

here’s our example


now su to your user

now do “sudo -s”

it’s saying don’t abuse the power you have, now enter your password

now once logged in, you will notice the # sign for shell, if you do whoami, it shows root (also logs in event log)

cat /var/log/messages | tail

You are now a SUDO user (do not abuse this, and only use when absolutely necessary)

That’s it!

To get a Hosted Linux Server visit to get started today!