Friday 17 June 2011

Recover Root Password for Solaris

Steps to reset root password

1) Boot the Solaris system and press "Stop  A". This interrupts the operating system boot process and it goes to 'OK' prompt.

2) Solaris sets the default root directory to /dev/dsk/c0t0d0s0. It can be change dipending on the layout the harddisks.

3) Type "boot cdrom -s" once you have reached the "OK" prompt. This instructs the System to load OS from the CD-ROM drive when you reboot.

4) Mount the partition using the #mount /dev/dsk/c0t0d0s0 /a" command line. If there is any complication at this stage, it means the root partition is actually located in a different spot than the default. You'll need to find the true root partition using the ls /tmp/dev/dsk command line.

5) Ensure that your terminal is set to accept commands through a full-screen editor. You won't be able to enter all of the necessary commands to recover the password otherwise.

6) Use the fsck -y /dev/dsk/c0t0d0s0 command once you receive any error messages stating that partitions failed to unload properly. This checks the hard drive's integrity.

7) Open the editor for the password file by typing /a/etc/shadow. This will open the root password file.

8) Remove the encrypted password as it appears in the password file.

9) Type cd/ followed by unmount a/ to prepare for the reboot. Rebooting is required to fully reset the password.

Thursday 16 June 2011

Recover Root Password for HP-UX

HP-UX  

The steps to reactivate the root account:

1. Boot the system in to single user mode.
2. Mount /usr file systems.
# mount /usr

Note: The file system might need file system check (fsck) before mounting.

3. Systems that are not using Trusted System security skip to step #4.
For Trusted Systems (presence of a /tcb directory), follow these additional

steps:
a) Use the following command to reactivate the 'root' account:
# /usr/lbin/modprpw -k root
b) Use the 'modprpw' command to null the password, so that the passwd command does not prompt for the old password.

For HP-UX 10.x
# /usr/lbin/modprpw -w "" root

For HP-UX 11.x
# /usr/sam/lbin/usermod.sam -F -p "" root

NOTE: To untrust the system, use: tsconvert -r

4. Change the root account password.
# passwd root

5. Boot the system in to multi user mode.