Operating System - Linux
1751858 Members
5496 Online
108782 Solutions
New Discussion

sudo priviledges in red hat linux

 
Beginner_2
Occasional Advisor

sudo priviledges in red hat linux

Hi,

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

Thanks,
Rahul
1 REPLY 1
Matti_Kurkela
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.

MK
MK