Recover root passwd - without the CDs: Solaris9/SunOS5.9
How can one recover or change root's passwd without having the installation CD's on Solaris?
Is it even possible?
Can't you boot to single-user mode from the hard disk. IIRC, at the boot prompt, you can type something like this:
OK boot /dev/dsk/c0t0d0s0 -s
-s tells it to boot in single user mode and /dev/dsk/c0t0d0s0 is assumed to be your boot partition (alter it to match your setup).
You may need to mount other partitions manually, depending on where vipw is (assuming that you're using vipw to edit your password). vipw is on /usr/sbin for Linux and I'm assuming that it is somewhere similar on Solaris. You might want to execute cat /etc/fstab to see the list of partitions and how each one should be mounted.
After that, u can edit the passwd file with vipw, blank out the password field and then reboot into regular mode.
Then log in as root with blank password. Immediately change your root password after logging in.
Hope this helps
I'll give it a shot - thanks!
June 10th, 2003, 11:39 AM
OK - root has been recovered... oh, and I got a copy of the Solaris CD 1 for this after all...
Here's how I did it:
- Press 'Stop A' simultaneously on the Sun Keyboard
- type 'sync' - this restarts the Blade, and protects the drives from becoming corrupted.
- After it restarts, Stop A again, then type 'boot cdrom -s'. This boots into single-user mode.
- mount /dev/dsk/c0t0d0s0 /a
- TERM=sun; export TERM
- vi /a/etc/shadow/
- Use vi to delete the password for root
- Save shadow in vi: type ": wq!"
- cd /
- umount /a
- cd /sbin
- init 6 (this reboots you - log in as root, open up a terminal, type passwd, reset your passwd, and you're done!)
Hope this helps someone else out there if they ever run into this situation...