Changing your username and password in Kali Linux requires command-line tools and root access
Kali Linux stores usernames and passwords in system files that only the root user can modify. You cannot change another user's password through the graphical interface — you must use the terminal and commands like usermod to rename an account or passwd to change a password. If you are locked out of your own account, you will need to boot into single-user mode or use a live USB to regain access.
The process differs depending on whether you are changing your own credentials or managing another user's account. Both tasks are straightforward once you understand which command does what and in what order to run them.
Key Takeaways
- Change your own password by opening a terminal and typing passwd, then entering your current password and the new one twice.
- Rename your username using sudo usermod -l newname oldname from a terminal, but you cannot do this while logged in as that user.
- Change another user's password with sudo passwd username if you have root access or are in the sudoers group.
- After renaming a user, you must also rename their home directory with sudo mv /home/oldname /home/newname so files stay accessible.
- If you forget your password, restart in single-user mode by holding Shift during boot and selecting the recovery option from the GRUB menu.
Changing your own password from the terminal
Open a terminal by pressing Ctrl+Alt+T or clicking the terminal icon in your taskbar. Type passwd and press Enter. The system will ask you to enter your current password, then prompt you twice to enter your new password. You must type it the same way both times or the change will not go through.
The new password takes effect when ready. You do not need to log out or restart. If you make a typo and the two entries do not match, the terminal will tell you "Passwords do not match" and ask you to try again.
Renaming your username
You cannot rename the user account you are currently logged in as. You must either log in as a different user with root access or use a second terminal session. The safest approach is to create a temporary admin account, log into that, and then rename your original account.
If you already have another admin account, log into it. Open a terminal and type sudo usermod -l newusername oldusername, replacing newusername and oldusername with the actual names. Press Enter and type your password when prompted. The system will rename the account when ready.
After renaming the account, you must also rename the home directory so the system can still find your files. Type sudo mv /home/oldusername /home/newusername and press Enter. Without this step, your desktop settings, documents, and other files in your home folder will become inaccessible.
Changing another user's password
If you have root access or are in the sudoers group, you can change any user's password without knowing their current one. Open a terminal and type sudo passwd username, replacing username with the account you want to change. Press Enter and type your own password when prompted.
The system will then ask you to enter the new password twice. You do not need the old password — this is useful if a user has forgotten theirs or if you are setting up a new account. The user can change it again themselves the next time they log in by using the passwd command.
What to do if you forget your password
Restart your computer. As soon as you see the Kali Linux boot screen, hold down the Shift key. This will bring up the GRUB menu with boot options. Look for an entry that says "recovery mode" or similar and select it. Press Enter to boot into single-user mode, where you will have root access without needing a password.
Once you reach the command prompt, type passwd username (or just passwd if you are resetting the root account). Enter your new password twice. Type exit to leave single-user mode and the system will boot normally. You can now log in with your new password.
Avoiding common mistakes when changing credentials
Do not rename a user account while logged in as that user — the system will not let you, or the change may cause problems. Always switch to a different account first or use single-user mode. Similarly, if you rename a user but forget to rename their home directory, they will log in but their desktop will look empty and their files will be inaccessible.
When typing a new password, remember that Linux is case-sensitive: "Password" and "password" are different. If you use special characters like $ or !, make sure you are not accidentally triggering shell commands. The safest passwords use letters, numbers, and common symbols like hyphens or underscores.
Using graphical tools as an alternative
Kali Linux includes a graphical user management tool called Users and Groups, though it has limitations. You can usually access it by right-clicking the desktop, selecting "Settings," and looking for "Users" or "Accounts." From there you can change your own password by clicking a lock icon and entering your current password.
However, the graphical tool cannot rename user accounts — you must use the terminal for that. If the graphical tool does not appear in your version of Kali, or if you need to manage multiple users, the command-line method is more reliable and works the same way on every Kali installation.
Frequently Asked Questions
Can I change my password without knowing the old one?
No, not for your own account. The passwd command requires you to type your current password first as a security check. If you have forgotten it, you must boot into single-user mode or use a live USB to reset it.
What happens to my files if I rename my username?
Your files stay on the disk, but the system will not find them unless you also rename the home directory from /home/oldname to /home/newname. If you skip this step, you will see an empty desktop after logging in with your new username.
Do I need to restart after changing my password?
No. Password changes take effect when ready. You can keep working without logging out or restarting. The next time you log in, use your new password.
Can I change the root password the same way?
Yes. Type sudo passwd root to change the root password, or just passwd if you are already logged in as root. You will need to enter your current password first, then the new one twice.
What if I get a "permission denied" error?
You are likely missing the sudo prefix. Commands that change usernames or other users' passwords require root access. Try again with sudo at the beginning, and type your password when prompted.