Where is the sudoers file on Solaris?

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


Solution 1:

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

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

see ^^^^ here.

Solution 2:

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

Solution 3:

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.

Solution 4:

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.