How to reset your password in Ubuntu
An Ubuntu Guide
In a business environment, resetting a forgotten user password is usually just a few mouse clicks away. At home, a family member or friend forgetting a password can get a little more complicated. Ubuntu has a few tricks up its sleeve to make life a little easier for you...
The first step is to get to the computer's boot menu.
If Ubuntu is the only operating system on your computer, you need to hold down the Shift key when you start your computer to bring up this menu. If Ubuntu is not alone on your computer then you'd be able to follow this tutorial from your usual boot menu
Select the Ubuntu 'recovery mode' option, as shown in the screenshot below
Once the recovery menu loads, you will need to select the Root option on the menu. This will open up a terminal interface as shown below
The 'root' account is the master account and can do anything to the Ubuntu installation, so please be careful with what commands you enter in the root terminal.
In recent versions of Ubuntu, the filesystem is mounted as read-only, so you need to enter the follow command to get it to remount as read-write, which will allow you to make changes:
mount -o rw,remount /
If the username is unknown as well you can run the following command to get a list of users in the Ubuntu installation:
Now to reset the password, remembering to replace the username code with the username of the account you want to reset:
When you type the password, nothing will appear on the screen. Your password is still being entered so just type in your new password. After hitting the Enter key you'll be asked to re-enter your password for confirmation.
If you have successfully changed your password, a message will appear telling you that the change is complete.
Now type in the following to return to the recovery menu:
Once at the recovery menu select the 'resume' option and you've got an active account again.