Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Where is the sudoers file in Solaris? Is it different between Solaris versions (specifically, 9 and 10)?

share|improve this question

5 Answers 5

Neither Solaris 9 or 10 include sudo - it wasn't bundled with Solaris until Solaris 11 - so for Solaris 9 & 10 the answer is “Whatever path was compiled into whatever version you installed.”

share|improve this answer
1  
One of the places to get sudo is OpenCSW. You can install a precompiled package. The sudoers file is then /etc/opt/csw/sudoers. –  automatthias Feb 28 '12 at 18:40

On MacOS X - I expect others are similar:

$ sudo visudo -c
Password:
/etc/sudoers: parsed OK

see ^^^^ here

share|improve this answer
    
That doesn't tell me where I can find the sudoers file in the file system. –  Jon Kruger Feb 11 '11 at 18:33
4  
It's right there in the last line of the output! –  Alnitak Feb 11 '11 at 18:36

Solaris has a more advanced privilege system than that. For example you can allow someone access to privileged ports without giving general root access. To do what sudo does, add the "Primary Administrator" profile to the user:

# usermod -P"Primary Administrator" someuser

And then under that user:

$ pfexec command

The profiles are defined in /etc/security/prof_attr. In there you'll see a list of the fine grained privileges in the profile. The user/profile assignments are in /etc/user_attr.

share|improve this answer
    
are you sure that it works like this in 9 and 10? I know this works in 11. I seem to remember RBAC only working in 9 if you had the special nerfed shell. –  cwebber Feb 24 '11 at 5:10

It depends where it was compiled into sudo; it can basically be anywhere, as long as the sudo and visudo tools both know about it.

I tend to run

strings `which sudo`

(which may need privilege) when I want to know where system X keeps its sudoers file.

share|improve this answer

instead of sudo, you can use

su -

share|improve this answer
    
That's true but is generally not considered a good thing. Having people use sudo or RBAC and pfexec allows what they do to be logged and audited. –  Iain Mar 5 '11 at 21:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.