DebugFactor.com | Forum

How to create a new sudo user in RHEL 6.x?

How can I create new users in RHEL 6.8 and assign then sudo access?

There are multiple ways to create sudo users in RHEL. The easiest way is to assign the user to the wheel group.

The wheel group is a special group which is available by default in most of the Linux distributions. To confirm if wheel group is available in your system, you can use this command.

[root@testvm ~]$ cat /etc/group
root:x:0:
bin:x:1:bin,daemon
daemon:x:2:bin,daemon
sys:x:3:bin
tty:x:5:
disk:x:6:
lp:x:7:daemon
mem:x:8:
kmem:x:9:
wheel:x:10:
mail:x:12:mail,postfix
man:x:15:
games:x:20:
video:x:39:
lock:x:54:
....

The group name wheel is derived from the phrase big wheel, which basically means someone with greater power.

In case if you want to see the description of the wheel group,

[root@testvm ~]$ cat /etc/sudoers
....
## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL
....

Now create a new user

[root@testvm ~]$ adduser joe

and to get the details of the user

[root@testvm ~]$ id joe
uid=502(joe) gid=503(joe) groups=503(joe)

Now to assign the user to the wheel group,

[root@testvm ~]$ usermod -aG wheel joe
[root@testvm]$ id joe
uid=502(joe) gid=503(joe) groups=503(joe),10(wheel)

Can this user stop/stop processes started by other users in the same wheel group?