Reset Linux root password is not hard if you have physical access to the Linux box. All you need is Kali live CD (or other Linux live CD).
This guide will show you how to reset Linux root password on VMware Linux virtual machine. But it’s exactly the same process on a physical Linux box.
Boot up Kali Live
Step 1: Download Kali iso image first.
Step 2: Insert the Kali iso image into CD/DVD device.
- select the Linux box on VMware Workstation
- go to Edit virtual machine settings > Hardware > CD/DVD (IDE)
- select Use ISO image file
- click Browse… and select the Kali iso image
Step 3: Assign 2GB memory
The Kali Live OS will run faster and smoother with at least 2GB RAM.
- select Memory
- drag Memory bar to 2 GB
- click OK
Step 4: Boot up Kali Live
- click Play virtual machine
- hit Esc key quickly to bring up the Boot Menu
- select CD-ROM Drive and hit Enter
- Hit Enter when Kali Boot menu appears
Wait for Kali Live to boot up. This would take couple minutes.
Step 5: Change root password
- click on Terminal icon to get a terminal
First we find out which hard drive partition contains the LInux kernel:
- type fdisk -l and hit enter
In my case, the device is /dev/sda3. It’s usually the one with the largest size. Now we can change the password by executing the following commands:
- mkdir /media/sda
- mount /dev/sda3 /media/sda
- chroot /media/sda
Password changed! You can now reboot the machine (shutdown -r 0) and login using the new password.