Kali Linux Forgot Root Password Fix [Solved]

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:

  1. Restart your computer. When the GRUB menu appears, use the arrow keys to highlight the default Kali GNU/Linux entry.
  2. Press ‘e’ on your keyboard to edit the boot parameters.
  3. Find the line that starts with linux. It usually ends with ro quiet splash.
  4. Change ro to rw and append init=/bin/bash to the end of that line.
  5. 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.

Step-by-step guide to resetting a forgotten Kali Linux root password via GRUB.

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.