I have forgot my root password. Solaris 10

hi everyone
i have forgot my root password and i have other user to login. can i get the password without restarting the server as that cant be afforded. . it is a Sparc architecture 2U blade server. it is old server mounted and functional since 2009. what should be the modus oprandee. i am novice to solaris .
plz guide what to check so that i can assess my chances of root password getting back etc

Regards

One of the best (and easiest) ways to recover the root password when you have physical access to the server is to boot from a different disk or partition and then mount the disk or partition with the lost root password file and edit the password file. Normally, just make the password entry blank.

Another way is to boot from a different disk or partition and then mount the disk or partition with the lost root password file and edit the password file and change the userid to "0" of a user whom you know the root password. This will give you root access to that "other user" and you can then change the password of root with that user (since their userid is 0).

Then reboot with the original disk and clean up any changes you made, change passwords, etc.

Always remember, if you have physical access to a computer / disk and loose any passwords, you can mount the disk (where the lost password file resides) and edit it on another computer, assuming of course you have root access on the secondary computer and the disk does not have special access controls in place (most do not).

2 Likes

I think Solaris Sparc does not make a 2nd bootable partition (recovery partition) by default.
So you'll need to boot from a Solaris installation CD (usually the 1st CD in the package). Do not start the installation, but open a shell.
From there mount your disk device to /a
Then your crypted root password can be deleted or changed in /a/etc/shadow
You have to know (or guess) your disk device. Look it up before, on your alive system with

df /

If it's like /dev/dsk/c0t0d0s0 then it is a physical disk, that you can mount when booted from CD.
If it's a Solaris volume manager disk then recovery might be more complicated; try the Oracle Web documentation.
If it's zfs then I have no experience...

You need to get on the system one way or another as superuser (root). Then edit /etc/shadow exactly as MadeInGermany says to remove the hashed password field for user root.

Usually superuser access is achieved by booting from DVD (installation media) into single user:

boot cdrom -s

which will not take you into the installation routine but allow you a shell to make changes.

This is easier if you are running simple UFS filesystems.

If your filesystems are ZFS then post back here and we'll tell you how to do it.

Hi. I had the same problem and this solution was really helpful. However, I was able to do this without an installation CD. From the login screen, I did a

STOP A

then boot into failsafe mode

boot -F failsafe

. As a bonus, when it reboots, it tells you what drive the operating system is on and asks you if you would like to mount it to /a. Here is my whole procedure:

From the login screen:
Stop A
At the {1}ok prompt:
boot -F failsafe
Screen echoes that it has found the disk with the OS and do you wish to have it mounted read-write on /a. Choose:
y
Instead of using EDIT command, you can use VI by entering
TERM=vt100
Export TERM
Edit the password file:
vi /a/etc/shadow
Use ghjk to navigate to the hashed password (between 1st and 2nd colons), then x to delete the characters.
Save the file:
:
w!
Exit the file:
:
Q
Power the machine off, then back on.

3 Likes

Thank you! I have never heard of the boot -F failsafe before.
Have read about it now: an Oracle article says it must exist as /platform/`uname -m`/failsafe .
I have access to an older Solaris 10 Sparc installation that does not have it. How to create it?

1 Like