Granting sudo privileges to general Linux users

1 Add the "abcde" user to the "wheel" group.

usermod -G wheel abcde

2 Edit visudo

visudo

3 Let's understand the meaning of the command

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL

root root user ALL = from all hosts (ALL) Can be run as any user ALL All commands can be executed


##4 Add permissions to the wheel group instead of root

The first "#Remove "" to enable this line.

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


##5 Check if the authority is working.
Log out of root and log in as the abcde user.

Here, let's execute a command that cat is not allowed to execute.
Since you do not have permission in the usual way, even if you run it as an abcde user, you will get an error saying "You do not have permission".

cat /var/log/secure


Now let's hit the same command with sudo first.

sudo cat /var/log/secure


If it can be executed, the authorization is completed.







Recommended Posts

Granting sudo privileges to general Linux users
Linux (for users and su / sudo commands)
[Linux] Introduction to Linux
How to allow nologin users to log in on Linux
linux basics (users / groups)
[Linux] su, sudo settings
Linux commands to remember
I want to use the latest gcc without sudo privileges! !!