How to recover/reset root password in Sun solaris (SPARC)

There is every little chance that one loses or rather forgets the root password of his Sun Solaris servers. In the event, this happens, there is a way out of it. Well the way and infact the only way is to reset the password as there is no way to recover it. Recovering/restting the password involves booting the server in Single User mode and mounting the root file system.

Ofcourse, it is recommeded that the security for the physical access to the server is restricted so as to ensure that there is no unauthorized access and anyone who follows this routine is an authorized personnel.

Boot the server with a Sun Solaris Operating System CD (I’m using a Solaris 10 CD but doesn’t matter really) or a network boot with a JumpStart server from the OBP OK prompt.

OK boot cdrom -s

or

OK boot net -s

This will boot the server from the CD or Jumpstart server and launch a single user mode (No Password).

Mount the root file system (assume /dev/dsk/c0t0d0s0 here) onto /a

solaris# mount /dev/dsk/c0t0d0s0 /a

NOTE: /a is a temporary mount point that is available when you boot from CD or a JumpStart server

Now, with the root file system mounted on /a. All you need to do is to edit the shadow file and remove the encrypted password for root.

solaris# vi /a/etc/shadow

Now, exit the mounted filesystem, unmount the root filesystem and reboot the system to single-user mode booting of the disk.

solaris# cd /

solaris# umount /a

solaris# init s

This should boot of the disk and take you to the single-user mode. Press enter at the prompt to enter a password for root.

This should allow you to login to the system. Once in, set the password and change to multi-user mode.

NOTE: Single-User mode is only to ensure that the root user without password is not exposed to others if started in multi-user mode before being set with a new password.

solaris# passwd root

solaris# reboot

This should do. You should now be able to logon with the new password set for root

6 thoughts on “How to recover/reset root password in Sun solaris (SPARC)”

  1. First sorry for my english,
    secondly that’s really nice but before doing that i’ve got a big snag:i’ve got a SunBlade 2000 server UltraSPARC-III+ but without CD-ROM device,there was already a solaris 10 into it,i don’t know the IP address i tried directly the “boot net -s” but it just display “3a000”,so if u can help me how can i reset password with that!!
    thank you in anticipation

  2. I have a Netra 440 server and no-one knows the root password. I have done this procedure step by step twice now and I will do it again to make make sure, but when I want to set the root password, I get a “Permission denied” error. I am trying to find the answer to this message on the web. Perhaps someone can help. Shall I mount the root partition again and change the permissions??? Please……

  3. Thanks Buddy!

    I forgot all these long time back..U helped me on urgent basis..

    Thanks a lot.

    Wishing you a Very Healthy-Wealthy-Sexy Life and a Bright Career Ahead..

    Take Care!

    Regards
    Viju

Leave a Comment

Your email address will not be published. Required fields are marked *