cancel
Showing results for 
Search instead for 
Did you mean: 

sudoers file for sudo

avizen9
Esteemed Contributor

sudoers file for sudo

HI
i would like to undestand what stand for below all Three ALL,

root ALL=(ALL) ALL

i had seen this line in my sudoers file,
i know root = root user

appriciate your reply on this, thanks,
10 REPLIES
Ivan Krastev
Honored Contributor

Re: sudoers file for sudo

See sudoers manual - http://sudo.ws/sudo/man/sudoers.html

There are lots of examples.

regards,
ivan
avizen9
Esteemed Contributor

Re: sudoers file for sudo

hi ivan
its still not clear to me, any other clue

VK2COT
Honored Contributor

Re: sudoers file for sudo

Hello,


The manuals are quite good so I am not sure
what puzzles you.

Anyway:

root ALL=(ALL) ALL

1 2 3

1 describes the server the sudo is allowed
to run execution on (in this case,
any server)

2 describes as which user root is allowed to
run sudo commands (in this case, any user)

3 describes which commands user root is allowed to execute (in this case, any command)

So, user root is allowed to run all commands as all users on any host!

Another example,

myuser myhost = (oracle) /bin/ls

User myuser is allowed to run /bin/ls
as user oracle on local server myhost...

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Ivan Krastev
Honored Contributor

Re: sudoers file for sudo

From the manual:

Aliases
There are four kinds of aliases: User_Alias, Runas_Alias, Host_Alias and Cmnd_Alias.

In your case:

root ALL = (ALL) ALL
is

User_Alias (root) Host_Alias (ALL) = Runas_Alial ((ALL)) Cmnd_Alias (ALL)


I hope its clear now.

regards,
ivan
VK2COT
Honored Contributor

Re: sudoers file for sudo

Ahh, again the wrong formatting of lines in the Forum.

Let's try again:

root ALL=(ALL) ALL
1 2 3

The rest of the explanation is as in the
previous post.

VK2COT
VK2COT - Dusan Baljevic
avizen9
Esteemed Contributor

Re: sudoers file for sudo

its looks ok for me,
let me try with it will let you know if still having any confusion,

thanks for your time :)
baong
Frequent Advisor

Re: sudoers file for sudo

Hi All,
Since we all talking about sudoer file, I have a question hopefuly you guys can help me out here.
In sudoer file i got a line is...

fred = ALL (DB) NOPASSWD: ALL

As far as i understand fred can run commands as oracle or sybase without a password, but where is fred define in sudoer file, how would sudoer file understand name "fred" outhere???
If you can help me out here i appricate your reply...Thanks
Tingli
Esteemed Contributor

Re: sudoers file for sudo

I think fred is listed in /etc/passwd.

man sudoers gives out a detailed description with numerous examples.
baong
Frequent Advisor

Re: sudoers file for sudo

Thanks for reply my question Avizen9. Another question please help me out here.
If i want to set user(DBA) act like a root, how do i setup in visudo file.

dba-user ALL = (ALL) ALL

And which command do i should switching to sudo
# sudo dba-user

Please help me out here
Thanks ALL
Sunny123_1
Esteemed Contributor

Re: sudoers file for sudo

Hi baong


Open a new thread this thread is one year old



Regards

Sunny