How to Reset Kali Linux Password – A Step‑by‑Step Guide
Resetting a forgotten Kali Linux password is a common task for system administrators, security professionals, and students who need to regain access to their machines. Worth adding: whether you are using a virtual machine, a dual‑boot installation, or a dedicated hardware box, the process is straightforward once you know the right commands. Practically speaking, this article explains how to reset Kali Linux password using four reliable methods, provides the underlying scientific explanation of why each works, and answers the most frequently asked questions. By following the steps below, you will be able to restore administrative access without reinstalling the operating system or losing data.
Understanding Password Reset in Kali Linux
Kali Linux is built on Debian, which uses the standard Unix password management system. User passwords are stored in the /etc/shadow file, which contains encrypted password hashes. Worth adding: when you change a password with the passwd or usermod commands, the system updates this file with a new hash. Resetting the password therefore means replacing the old hash with a new one, or temporarily granting root privileges to set a new password manually.
- /etc/shadow – stores password hashes securely.
- Root user – has unrestricted access and can modify any user’s password.
- Single‑user mode – boots the system into a runlevel where only root can log in, simplifying password changes.
Understanding these fundamentals helps you choose the most appropriate reset method for your situation.
Method 1 – Using the usermod Command
The usermod command allows you to modify user attributes, including the password. This method is ideal when you can still log in as root or have sudo privileges The details matter here. Which is the point..
- Open a terminal and become root (if you have sudo rights):
sudo -i - Run the usermod command to set a new password:
Replaceusermod -p NEW_PASSWORD_USERNAMENEW_PASSWORDwith the desired clear‑text password andUSERNAMEwith the target account name. - Verify the change:
The output should showpasswd -S USERNAMEU(locked) orP(locked) indicating the password status.
Why it works: usermod updates the entry in /etc/shadow directly, replacing the old hash with the new one. This is the fastest way to reset a password when root access is available Not complicated — just consistent..
Method 2 – Using the passwd Command
If you are already logged in as the user whose password you want to change, the passwd command is the simplest approach That's the part that actually makes a difference..
- Log in (or switch to the user) and execute:
passwd - Enter the current password (if known) or skip this step if you are using root.
- Type the new password twice to confirm.
- Password aging options can be set, but you can press Enter to accept defaults.
Important note: Never reuse old passwords that are still recognizable; choose a strong, unique password to enhance security But it adds up..
Why it works: The passwd utility reads and writes the /etc/shadow file, performing the same hash replacement as usermod but in a user‑friendly interactive format Worth keeping that in mind..
Method 3 – Resetting via Recovery Mode
Every time you cannot log in at all, booting into recovery mode provides a root shell without needing the user’s password.
- Reboot the system and hold the Shift key (BIOS) or Esc key (UEFI) to access the GRUB menu.
- Choose the “Advanced options for Kali Linux” entry, then select the recovery mode option (usually the one ending with
(recovery mode)). - You will be presented with a menu; choose “root – Drop to root shell prompt”.
- Remount the root filesystem in read-write mode:
mount -o remount,rw / - Reset the password using either
passwdorusermodfor the desired user:passwd USERNAME - Reboot the system:
reboot
Why it works: Recovery mode boots the kernel with limited services, mounting the root filesystem read‑write allows you to modify /etc/shadow directly, effectively resetting the password.
Method 4 – Using a Live USB
If the system’s bootloader is corrupted or you cannot access recovery mode, booting from a Kali Linux Live USB gives you full control over the disk.
- Create a bootable Kali USB using a tool like Rufus or Etcher.
- Boot the target machine from the USB and choose “Try Kali” (live environment).
- Open a terminal and identify the installed partition (e.g.,
sudo fdisk -l). - Mount the root partition to a temporary directory:
sudo