System Administration
Showing results for 
Search instead for 
Did you mean: 

sudo priviledges in red hat linux

Occasional Advisor

sudo priviledges in red hat linux


Which file is used to give specific sudo privileges to particular user?

because when i do "sudo sh" on my system , i get extra privileges. which file i should look to get to know the concept of it

Honored Contributor

Re: sudo priviledges in red hat linux

When you run "sudo sh", it means you're running the "sh" using the identity and privileges of the root user.

You could instead do "sudo -u someuser sh" to run "sh" as user "someuser". If you don't use the -u option to specify the user you want, sudo assumes you're trying to run the command as root.

The sudo privileges are controlled by the sudoers file, typically located at /etc/sudoers in Linux. But you should never edit this file directly: you should use the "visudo" command instead.

The "visudo" command uses your favorite text editor (specified using environment variable EDITOR or VISUAL), or the vi editor if no favorite has been specified. It will make a temporary copy of the real sudoers file and allow you to edit the copy. Once you exit the editor, visudo will check the edited copy for syntax correctness; the real sudoers file will be replaced with the edited version only if the syntax is correct.

The "man" command can be used to get instructions about the use of each command and many configuration files; run "man sudo", "man sudoers" and "man visudo" to see information about sudo.