Applies to: Ubuntu 26.04 LTS / 24.04 LTS / 22.04 LTS / 20.04 LTS / 18.04 LTS / 16.04 LTS
If you forget the password for a local Ubuntu account, you can reset it from recovery mode as long as you have access to the machine and the disk can be unlocked.
The original version of this article used an old GRUB method that edited the kernel line and added rw init=/bin/bash. That approach can still work in some cases, but Ubuntu now provides a cleaner recovery-mode path that is easier to follow and less error-prone.
In This Article
- 1. Before You Start
- 2. Boot Ubuntu into Recovery Mode
- 3. Remount the Root Filesystem
- 4. Reset the User Password
- 5. Reboot and Test
- 6. Full Disk Encryption
- 7. Key Takeaways
1. Before You Start
This procedure resets the password of a local Ubuntu user account. It does not recover the old password.
You need console access to the machine. If the system uses full-disk encryption, you must also be able to unlock the disk before Ubuntu can access the installed system.
If you can still sign in with another administrator account, the easier option is to change the affected user’s password from Settings > System > Users instead of using recovery mode.
2. Boot Ubuntu into Recovery Mode
- Restart the computer.
- Display the GRUB menu. On many BIOS systems, hold Shift while the machine starts. On some UEFI systems, pressing Esc repeatedly works better.
- Select Advanced options for Ubuntu.
- Select the required kernel entry that ends with (recovery mode).
- From the recovery menu, select root – Drop to root shell prompt.
You should now have a root shell, but the root filesystem may be mounted read-only.
3. Remount the Root Filesystem
Remount the root filesystem with write access:
mount -o remount,rw /
If the command completes without an error, the filesystem is writable and you can change the account password.
4. Reset the User Password
Use the passwd command with the local username:
passwd username
Enter the new password twice when prompted. Replace username with the actual local account name.
If you are not sure of the username, you can list normal local user home directories:
ls /home
5. Reboot and Test
After the password has been changed successfully, reboot the system:
reboot
Allow Ubuntu to start normally and sign in with the new password.
If the desktop keyring still uses the old password, Ubuntu may ask for the previous keyring password or offer to create a new keyring. Resetting the Linux account password from recovery mode does not decrypt a keyring that was encrypted with the old password.
6. Full Disk Encryption
Password reset and disk encryption are separate layers. If the Ubuntu installation uses encrypted storage, recovery mode cannot bypass the disk unlock requirement.
On systems using Ubuntu’s hardware-backed disk encryption, Canonical documents a recovery key for situations where the normal disk PIN or passphrase cannot be used. Losing both the normal unlock method and the recovery key can result in loss of access to the encrypted data.
7. Key Takeaways
- Use Ubuntu recovery mode instead of editing the GRUB kernel line unless you specifically need the manual method.
- Remount the root filesystem read-write before running passwd.
- The procedure resets the local account password; it does not recover the old password.
- Full-disk encryption must still be unlocked before the installed system can be accessed.
- A password reset from recovery mode may leave the desktop keyring encrypted with the previous password.
References
- Ubuntu Community Help Wiki – Lost Password
- Ubuntu Help – Change your password
- Ubuntu Desktop documentation – Hardware-backed disk encryption

Cloud and infrastructure professional with nearly two decades of experience in enterprise IT environments, spanning public cloud, private cloud, and hybrid architectures.