# Root password recovery

I have an SGI ALTIX 3000 running Red Hat Enterprise Linux AS release 3, with two disks, disk #1 i have the root password disk#2 i don't have the root paswword.. how can i recover the root password for the disk#2.. Thank you for the help

-

## 1 Answer

You can't "recover" the other password (other than trying brute force-type approaches on the /etc/shadow file). But you can reset it.

If you haven't done that already, before you do anything else, it might be a good time to back up that disk#2.

One way of resetting that root password is to mount the partition that contains / on disk#2 to some temporary directory, then chroot to that and use passwd to reset the password on that partition.

# mkdir /tmp/recover
# mount /dev/name_of_the_device_file_for_the_slash_partition_on_disk_2 /tmp/recover
# chroot /tmp/recover
# passwd
<enter new password>
# exit
# umount /tmp/recover
# rmdir /tmp/recover
# echo done!


Just make real sure you type that password correctly and inside the chroot otherwise you'll be resetting disk#1's root password obviously.

-
YES, the root passwd was changed successfully.. Thank you Mat for you help –  AlBouazizi Apr 7 '11 at 12:40
Thank you your answer helped me alot.. –  AlBouazizi Apr 14 '11 at 17:39