Forgetting your Ubuntu Linux password can be frustrating, but don’t panic! There are a few ways to regain access to your system. This guide will walk you through some common solutions.
Reset Password via Recovery Mode
- Boot into Recovery Mode:
- During system startup, press and hold the Shift key to enter the GRUB boot menu.
- Select your Ubuntu system and press ‘e’ to enter edit mode.
- Locate the line starting with “linux” and append “init=/bin/bash” at the end.
- Press Ctrl+x or F10 to save and boot.
- Mount File System and Change Password:
- In the bash prompt, type the following commands:
mount -o remount,rw /
passwd
UserName- Enter the username for which you want to change the password and follow the prompts to set a new one.
- Reboot:
- Type
reboot
to restart your system and log in with the new password.
- Type