Immediate Fix: Resetting Password via GRUB
If you are locked out of your Kali Linux system, the fastest way to regain access is by intercepting the bootloader. This method allows you to access a root shell without knowing the current password.
Follow these steps to reset your password immediately:
- Restart your computer. When the GRUB menu appears, use the arrow keys to highlight the default Kali GNU/Linux entry.
- Press ‘e’ on your keyboard to edit the boot parameters.
- Find the line that starts with
linux. It usually ends withro quiet splash. - Change
rotorwand appendinit=/bin/bashto the end of that line. - Press Ctrl+X or F10 to boot with these modified parameters.
Once the bash prompt appears, use the following commands to change the password:
# To change the root password
passwd root
# To change a specific user password
passwd your-username
# Sync and reboot
sync
reboot -f
Technical Explanation
When you modify the GRUB parameters, you are telling the Linux kernel to bypass the standard init process. By setting init=/bin/bash, the system drops you directly into a Bourne-Again Shell with root privileges before the login manager even starts.
Changing ro (read-only) to rw (read-write) is critical. By default, the root partition is mounted as read-only for safety. If you don’t change this, the passwd command will fail because it cannot write the new password hash to the /etc/shadow file.
| Parameter | Function |
|---|---|
| rw | Mounts the filesystem with Write permissions. |
| init=/bin/bash | Overrides the default init system to launch a shell. |
| passwd | The utility used to update user authentication tokens. |

Alternative Methods
If the GRUB method is restricted by a BIOS/UEFI password or a GRUB password, you will need to use an external recovery tool. The most reliable alternative is using a Kali Linux Live USB.
Method 1: Using Kali Live USB
Boot from a Kali Live USB and select “Live System.” Once the desktop loads, open a terminal and identify your root partition using fdisk -l. Mount the partition and use chroot to change the password.
# Example of mounting and chrooting
sudo mount /dev/sda1 /mnt
sudo chroot /mnt
passwd root
exit
sudo reboot
Method 2: Recovery Mode
Some Kali installations include a “Recovery Mode” or “Single User Mode” entry in the Advanced Options of the GRUB menu. Selecting this may prompt for the root password; however, if the account is not fully locked, it may provide a maintenance shell where the passwd command can be executed.
Always remember to document your new credentials in a secure password manager to avoid future lockouts.