-1

I am doing this on Solaris 11. When i open '/etc/nsswitch.conf' i see this -

...
sudoers:  files
...

I would like to change this to -

...
sudoers:  files ldap
...

I tried editing the file directly, but when i reboot host, changes are lost. I tried using svcfg, but that didnt work -

root@solaristhost:/# svccfg
svc:> select name-service/switch
svc:/system/name-service/switch> setprop config/sudoers = "files ldap"
Type required for new properties.
svc:/system/name-service/switch> exit

Is there some way to set the 'sudoers' value in nsswitch permanently using the svccfg command or some other command?

Quest Monger
  • 189
  • 2
  • 4
  • 12

2 Answers2

2

In addition to the missing type parameter, note also that the property in the service configuration is named 'sudoer', not 'sudoers'. Also, it is necessary to refresh the service after changing its configuration.

# svccfg -s system/name-service/switch  
svc:/system/name-service/switch> setprop config/sudoer = astring: "files ldap"
svc:/system/name-service/switch> exit
# svcadm refresh system/name-service/switch
alanf12k
  • 21
  • 3
1

The session you quote has a clue in the error message

Type required for new properties.

It looks like you're missing a required type parameter and the Documentation has more information

# svccfg -s system/name-service/switch  
svc:/system/name-service/switch> setprop config/host = astring: "files dns nis"
svc:/system/name-service/switch> quit

Note the astring: type ...

user9517
  • 115,471
  • 20
  • 215
  • 297
  • Thanks. This worked. Now when i do 'listprop config/sudoers' i can see "files ldap". But this value is still not reflected in '/etc/nsswitch.conf'. It still reads 'sudoers: files'. Are these changes made with svccfg supposed to reflect back in nsswitch.conf? – Quest Monger Apr 15 '14 at 17:54
  • @QuestMonger: I've no idea I just read the docs - I don't have much to do with Solaris these days. – user9517 Apr 15 '14 at 17:59
  • np. i found another way to do this. using nscfg - http://www.c0t0d0s0.org/archives/7452-Solaris-11-features-nscfg.html – Quest Monger Apr 15 '14 at 20:39