#1
  1. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,183
    Rep Power
    2220

    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?
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,592
    Rep Power
    4207
    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
  4. #3
  5. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,183
    Rep Power
    2220
    I'll give it a shot - thanks!
  6. #4
  7. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,183
    Rep Power
    2220
    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...
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn

IMN logo majestic logo threadwatch logo seochat tools logo