To grant sudo access to a user in a Linux system, you can follow these steps:
-
Add the user to the sudo group (replace
usernamewith the actual username):sudo usermod -aG sudo username -
Verify that the user has been added to the sudo group:
groups usernameThe output should include the "sudo" group.
-
Test the sudo access by switching to the user and running a command that requires sudo privileges:
sudo su - username sudo command_to_run -
Exit the user session to return to your original user:
exit
This process allows the specified user to execute commands with elevated privileges using sudo.
