- Published on
Ubuntu Password Reset
- Authors
- Name
- Mike Hacker
- @ki5ibd
1. Boot into Recovery Mode
- Restart your computer.
- As the system boots, hold down the Shift key (or press Esc repeatedly on UEFI systems) to access the GRUB menu.
- In the GRUB menu, select the option labeled Advanced options for Ubuntu.
- From the submenu, select a kernel with (recovery mode) appended.
2. Access the Root Shell
- When the recovery menu appears, select root - Drop to root shell prompt.
- You’ll be prompted with a command-line interface as the root user.
3. Remount the File System with Write Permissions
The root filesystem is mounted as read-only in recovery mode. To change it to read-write, enter:
mount -o remount,rw /
4. Reset Your Password
To reset the password for a user account, type:
passwd username
Replace username
with your actual username. You’ll be prompted to enter a new password.
5. Update Permissions (if needed)
If you encounter permission issues, update file permissions with:
chmod 640 /etc/shadow
6. Reboot the System
Once done, reboot the system:
reboot
Tips:
- If the above fails due to encryption or other security settings, you might need additional troubleshooting.
- Always ensure you remember your passwords or have a recovery mechanism in place.