How to reset forgotten user/boot password in Ubuntu

If you forgot your ubuntu user password,or you have enabled root user and forgot the password,you can try following to reset the forgotten password.

First,start your machine and when it boots into grub menu,select “Ubuntu GNU Linux …. (recovery mode)” (just use up/down arrow key to highlight it,not press enter).

Press E to get into edit screen,there  find ro single and change it into rw single init=/bin/bash,then press Ctrl+x or b to boot into a command line.

type following command:

mount -a
passwd your-user-name

it will prompts to input new password.If you want to reset the root password,change the second command to passwd root.
Now,restart and login with the new password.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s