Useful shortcuts for vi editor

Wednesday 13 July 2022

How to add a user into "wheel" group?

For example, you have only a root user for the super-user activities, but you wanted to use a custom user for some specific purposes. To make this, you might use "wheel" user group which is a special one for the "sudo" operations. 

Action
sudo usermod -aG wheel alperadm

Check and Determine the Option:
$ sudo cat /etc/sudoers

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

## Same thing without a password
%wheel        ALL=(ALL)       NOPASSWD: ALL

$ cat /etc/group | grep wheel
wheel:x:10:root,alperadm

Test
$ cat /etc/sudoers
cat: /etc/sudoers: Permission denied

$ sudo cat /etc/sudoers
Worked!