In this post I am going to lay down simple steps to allow you to retrieve passwords from both virtual systems (vmachines) and physical ones.
- LiveCD -- it is best that you have a liveCD kept somewhere for emergency. This CD either in physical media and/or ISO image will go along way.
- A good procedure to work on.
Procedure:
----------------------------------------
- If it is a physical box, configure your BIOS to boot to your CD/DVD-ROM drive. If it is a virtual machine, you will have to configure it to boot from an ISO image somewhere in you system.
- Do this as root. Identify the partition which needs to be accessed via "chroot".
- Create a staging directory for the system you intend to recover.
- Mount that system using this command: e.g. mount -rw -t ext4 /dev/sda4 /mnt/
- chroot /mnt/
-- this would drop you to the chrooted environment of the system you intend to recover. - Issue the command: "pwconv" (The "pwconv" command creates shadow from passwd and an optionally existing shadow)
Cheers!!!