Grant sudo access to a user
In RHEL, you can allow non-root users to enter administrative commands by granting them sudo access. This ensures that users can perform privileged tasks securely without requiring the root user’s password.
Before you begin
- You have root access to the system.
About this task
When users need to perform an administrative command, they can precede that command with sudo. If the user has authorization for the command, the command is executed as if they were root.
Be aware of the following limitations:
- Only users listed in the
/etc/sudoersconfiguration file can use thesudocommand. - The command is executed in the shell of the user, not in the root shell. However, there are some exceptions such as when full
sudoprivileges are granted to any user. In such cases, users can switch to and run the commands in root shell. For example: -
sudo -i -
sudo su -
Procedure
Results
- Verify that the user is in the administrative
wheelgroup:# id <username>uid=5000(<username>) gid=5000(<username>) groups=5000(<username>),10(wheel)