Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

If you have sudo, the visudo command should tell you where the sudoers file is.

$ sudo visudo -c
/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
It's right there in the last line of the output! – Alnitak Feb 11 '11 at 18:36

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
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

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

/opt/csw/etc/sudoers is path....

share|improve this answer
Not universally though, (see the other answer with the suggestion to use visudo to find the specific path for your sudo build). – HBruijn Nov 20 '15 at 10:51
@HBruijn which for some reason I just got downvoted for :( – Alnitak Nov 20 '15 at 12:46

Your Answer


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.