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)

 Add user to Sudoers Group CentOS

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

 Add user to Sudoers Group CentOS

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

 Add user to Sudoers Group CentOS

scroll down to this line

 Add user to Sudoers Group CentOS

add the username you want to give sudo permissions to in the same format as root Add user to Sudoers Group CentOS

here’s our example

save/quit

now su to your user

 Add user to Sudoers Group CentOS

now do “sudo -s”

 Add user to Sudoers Group CentOS

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

 Add user to Sudoers Group CentOS

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

 Add user to Sudoers Group CentOS

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 www.zwiegnet.com/go to get started today!