Password recovery of Kali Linux

Amrit GiriAmrit Giri
2 min read

Have you ever forget your password? Unfortunately, I have forgotten my password recently and have hacked my way back in. At first, I thought I might have to reinstall the whole thing and start my setup over again, but there was another way to get into the system which I was unfamiliar with.

Firstly, reboot the system and get out of the login screen, eventually you will see the GRUB menu. If GRUB menu is not visible to you then check the half way of this blog. When you finally see the GRUB menu, just press key “e” to edit the boot options similar like this:

setparams 'Kali GNU/linux'
  load_video
.....
.....
echo    'Loading Linux ....'
linux    /vmlinuz-... root=/dev/mapper/.... ro quiet mitigations=off splash
....
....

Then you need to look for “linux” line in the option. Move towards the end of that particular line and replace “ro quiet splash” with “rw init=/bin/bash” as shown below:

...
...
linux    /vmlinuz-... root=/dev/mapper/.... mitigations=off rw init=/bin/bash

After this, you need to either press “ctrl+x” or “F10” which will boot you straight into a root shell.

root@(none):/#

Here check for the user that you want to change password. If you want to be sure of the spelling then as root user you can do anything, so just check the “/etc/passwd” for the username. Suppose, if “kali” is the username then simply run

root@(none): passwd kali
New password:
...
...

Type in your new strong password and exit the system by exit command or pressing ctrl+d.

0
Subscribe to my newsletter

Read articles from Amrit Giri directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Amrit Giri
Amrit Giri

I am currently pursuing a bachelor's degree in Electronic, Communication and Information Engineering at Pashchimanchal Campus(WRC), IOE, Tribhuvan University. I am passionate about Cybersecurity, Software Development and Data Science.