# Password recovery of Kali Linux

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**](https://medium.com/@amritgiri/fix-linux-crashes-and-grub-issues-after-updates-9da06c8f9bdb). When you finally see the GRUB menu, just **press key “e”** to edit the boot options similar like this:

```plaintext
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:

```plaintext
...
...
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.

```plaintext
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

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

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