I Forgot My Ubuntu Password: Solutions and Step by Step Guide
I Forgot My Ubuntu Password: Solutions and Step-by-Step Guide
Forgot your Ubuntu password? Don’t worry, this is a common issue, and there are various solutions available. In this guide, you will learn the effective methods to reset your Ubuntu password step by step.
Resetting Password Using Ubuntu Recovery Mode
Ubuntu allows you to resolve system issues using recovery mode. You can use this mode to reset your password:
- Turn on your computer and hold the Shift key until the Grub menu appears.
- From the Grub menu, select "Advanced options for Ubuntu".
- From the list, navigate to the entry that contains "(recovery mode)" and press Enter.
- In the recovery menu, select the "root" option. This will start the system in root user mode.
- At the command prompt, type
mount -o rw,remount /to make the file system writable. - Then, enter the command
passwd usernameto set your new password. - After confirming your new password, type
rebootto restart the system.
Using a Live USB to Recover the Password
If you have an Ubuntu installation USB, this method works quite well:
- Insert the Ubuntu Live USB into your computer and boot from the USB.
- When the Ubuntu interface loads, select the "Try Ubuntu" option.
- Open the terminal and type
sudo fdisk -lto find the disk partition where Ubuntu is installed. - Mount the disk partition using the command
sudo mount /dev/sdXY /mnt(replace sdXY with your actual disk partition information). - Type
sudo chroot /mntto switch to the root directory. - Use
passwd usernameto set your new password. - Finally, type
exitto exit the command prompt and restart the system.

Resetting Password via Grub Menu
You can also reset your password from the Grub menu. Here are the steps:
- Turn on your computer and hold the Shift key until the Grub menu appears.
- When you reach the Ubuntu entry, press the e key to enter the edit mode.
- At the end of the Linux line, add
init=/bin/bash. - Press Ctrl + X to start the system with these settings.
- At the command prompt, type
mount -o remount,rw /to make the file system writable. - Use
passwd usernameto set your new password and typerebootto restart the system.
Changing Password by Accessing Root User
Accessing the root user is an effective way to reset the password:
- Enter recovery mode and select the "root" option to access the system as a root user.
- To make the file system writable, type
mount -o rw,remount /. - Enter
passwd usernameto set your new password. - After confirming the new password, type
rebootto restart the system.
Resetting Password via SSH Connection Remotely
It is possible to reset the password remotely via SSH, but SSH access must have been previously enabled:
- If you have SSH access, connect to your Ubuntu system from another device using a terminal or SSH client.
- Once the SSH session opens, type
sudo passwd usernameto set your new password. - After successfully changing your password, log out and continue using the system normally.
Frequently Asked Questions
- I forgot my Ubuntu password, how do I access recovery mode?
- Hold the Shift key during boot to access the Grub menu, then select the recovery mode option.
- Which Ubuntu version should I use to change the password via a Live USB?
- It is generally recommended to use the most up-to-date Ubuntu Live USB version, but ensure it is compatible with your installed system version.
- I cannot access the Grub menu, what should I do?
- Your system might have a fast boot setting or BIOS security options. Check these settings to ensure the Grub menu is visible.
- Is it secure to reset the password remotely via SSH?
- Yes, but it is recommended to do this only via a secure connection and when SSH access is properly configured.
Comments0
No Comments Yet
Be the first to share your thoughts.
Please sign in or sign up to leave a comment.