Configuring sudo access for administrative tasks
There is a way to delegate administrative access to users in RHEL, and it is done so with a tool called sudo, which stands for Super User Do.
It not only allows you to grant full administrative privileges to users or groups but also be very granular on the privileged commands that some users may be able to execute.
Let's start by understanding the default configuration and how to change it.
Understanding sudo configuration
The tool has its main configuration file in /etc/sudoers
and includes this part in the default configuration:
root ALL=(ALL) ALL %wheel ALL=(ALL) ALL ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) #includedir /etc/sudoers.d
Let's analyze the lines one by one to understand what they do.
The first line enables the root
user to use sudo
for any command that they want to run:
root ALL=(ALL) ALL...