11

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

Jon Kruger
  • 241
  • 2
  • 4
  • 9

7 Answers7

10

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.

Alnitak
  • 21,191
  • 3
  • 52
  • 82
7

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

alanc
  • 1,500
  • 9
  • 12
  • 4
    One of the places to get sudo is OpenCSW. You can install a precompiled package. The sudoers file is then /etc/opt/csw/sudoers. – automaciej Feb 28 '12 at 18:40
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.

JOTN
  • 1,747
  • 1
  • 10
  • 12
  • 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 05:10
2

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.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
1

It's under /usr/local/etc on my Oracle Solaris 10 1/13 s10x_u11wos_24a X86 system. There was no visudo command.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
user368491
  • 11
  • 1
0

instead of sudo, you can use

su -

doh45
  • 9
  • 1
  • 1
    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. – user9517 Mar 05 '11 at 21:20
-1

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

HBruijn
  • 77,029
  • 24
  • 135
  • 201