Add User to Sudoers on CentOS

You can do this in 2 methods- however, IMHO method-2 usually works great for me.

Method-1

Step 1: Verify the Wheel Group is Enabled

Your CentOS 7 installation may or may not have the wheel group enabled. Open the configuration file by entering the command:

visudo

Scroll through the configuration file until you see the following entry:

## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

If the second line begins with the # sign, it has been disabled and marked as a comment. Just delete the # sign at the beginning of the second line so it looks like the following:

%wheel        ALL=(ALL)       ALL

Then save the file and exit the editor.

Read more

Share

Creating a Sudo User in Debian or Ubuntu

Creating a Debian Sudo User

Creating a Debian sudo user involves a few simple steps. This procedure does not require you to edit the sudoers file. If you have an existing user that you want to grant sudo privileges, skip Step 2.

Step 1: Log in as the Root User

Before you can add a user to your system, log in to your server as the root user:

ssh root@ip_address

Replace ip_address with the IP address of your server.

Read more

Share