This has happened few times for me in the past and this guide will provide all the steps that is required to recover the root password.
- I assume you own the server whose root password you are trying to recover.
- You are not hacking into a system that you do not “own”
- I bear no responsibilities on the damages caused.
Steps to Recover
- Assuming you have a boot drive e.g. USB stick or DVD drive, burn a Live ISO can be any flavor, Fedora or Ubuntu or Knoppix.
- Boot into the Live OS by changing the BIOS boot to start from USB or DVD
- When the live OS has launched sucessfully, open the “Terminal” window
- Run the following command to mount the hard drive
- $ sudo mount /dev/sda1 /media/sda1
- Edit the file /media/sda1/etc/shadow
- Delete the long string after root: until next “:”
- Reboot Linux VM
- Login console, use root and blank password