0

Ok, so I was editing the name-service/switch service and messed up my nsswitch.conf, I overwrote the "passwd = files" with "passwd = filesasdf" so now I can't auth to the server when I boot that kernel. I can however just boot to the default Solaris 11/11 kernel and auth again just fine the problem is that there has been a lot of tweaking done (not all of it by me, nor necessarily documented) and I would like to be able to auth to that kernel and continue tweaking/tuning/learning and whatnot.

The problem is I have no idea how to go about getting access to the service on that alternate kernel (since Solaris 11 doesn't even use the nsswitch.conf file anymore). I imagine it is just a ZFS snapshot or something that holds the newer kernel so it would likely involve mounting that snapshot and editing whatever file the name-service now looks to (doesn't it have to look at a file at some point?).

In any case, I am also new to Solaris so this is kind of an adventure.

Joe
  • 11
  • 2

2 Answers2

2

I can however just boot to the default Solaris 11/11 kernel and auth again just fine

... so boot to that kernel and undo the damage you did to /etc/nsswitch.conf.
Problem solved. This will cost you five dollars, Charlie Brown.


If your system is hosed to the point where you can't log in boot it in single user mode and fix the file.

voretaq7
  • 79,879
  • 17
  • 130
  • 214
  • Solaris 11 no longer uses the nsswitch.conf to manage these things, it's managed via the service. The service, as far as I know, ignores the .conf file now (per the verbiage in the conf file itself). Secondly, if it was even the same conf file I wouldn't be able to authenticate in the first place to log back in. – Joe Jan 15 '13 at 03:27
  • This is where single user mode comes in Joe... (also the need to fix `/etc/nsswitch.conf` is taken from *your problem description* - If you caused the problem by modifying something else, like `svc:/system/name-service/switch:default` in SMF, you can fix it with the appropriate management command, like `svccfg` & `svcadm`...) – voretaq7 Jan 15 '13 at 03:44
  • I will have another look. I did attempt to use svccfg to fix the problem but it threw a pretty hard error, something like "error on line 28432 in asdf.c" (wish I hadn't closed that ssh window like an idiot). I would guess that error is happening because authentication is all kinds of screwed now, if single user mode stops that error I will be in business. – Joe Jan 15 '13 at 06:48
1

If by "booting to another kernel" you mean booting to an alternate Boot Environment (BE), then boot to that kernel, use 'beadm list' to determine which boot environment is the one you need to fix, and mount it.

    beadm mount beName mountpoint

For example, if your broken boot environment is "solaris-2", and you have a working "solaris-1" boot environment, boot into solaris-1, and run:

beadm mount solaris-2 /mnt

Then you can cp your working BE's nsswitch to conf to the broken BE.

cp /etc/nsswitch.conf /mnt/etc/nsswitch.conf

Then, reboot, select the "solaris-2" BE from Grub, and you should be good to go.

Tim Kennedy
  • 1,214
  • 10
  • 13
  • That would've been exactly what I was looking for, shame I didn't see it before I nuked the entire thing. – Joe Apr 16 '13 at 17:43