Add User to Administrative Group (Sudoer)

Add User to administrative Group (Sudoer)

The sudo command stands for “Super User DO” and temporarily elevates the privileges of a regular user for administrative tasks. The sudo command in CentOS provides a workaround by allowing a user to elevate their privileges for a single task temporarily.

  1. Login as Root user.
  2. Create new user using: [root@localhost ~]# adduser raz

Here new user name raz is created. To set password of user raz using [root@localhost ~]# passwd raz

2. Verify the Wheel Group is enabled by using [root@localhost ~]# visudo

Check for this line:

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

3. Add User to Group:
[root@localhost ~]# usermod -aG wheel raz
4. Switch to the user raz

su – raz 

Enter the password if prompted. The terminal prompt should change to include the UserName.

Enter the following command to list the contents of the / directory

 

 

Leave Comment

Your email address will not be published.