Apr 102013
 

This is an easy and simple solution based on the article by Umair, first posted on http://www.noobslab.com.

it’s common that, if not you, one of your familiar or friends forget his login password, and if this is the only account available on the system this means that he’s usually locked out from his computer, luckily this is not a big issue if you have physical access to the console of a Linux system, as we can use the recovery mode available from the grub menu of most distributions (if not all).




So the first step is to reboot the system and select the Recovery Mode:

lost_pwd01

After a few moments you will see the following screen. Now select “root – Drop to root shell prompt” and press “Ok”

lost_pwd02

If you forgot your username enter this command to see all the users:

 ls /home

Just remember that linux is case-sensitive about username and password, If you have upper case in your user name than you need to enter the same letters.
Now use the following command to reset your password:

        passwd username

For example (See the picture above):

        passwd noobslab

Now enter your new password and confirm it.
Reboot the computer with the command:

        exit

That’s it, you can now login with your new password.

Is this a security issue ?
Yes and not, for Gnu/Linux systems if you have physical access to a computer you are a super-admin, and so you can use this method, or start with a live distribution to recover all the credentials of the system.
If you are worried about this you should probably set various layer of protection such as Password protected bios and grub and encrypted disk information (at least /home), perhaps these are good ideas for next articles.


Popular Posts:

Flattr this!

  One Response to “How to reset your forgotten password on Gnu/Linux”

  1. I had to do this before:
    Do this two things just to make sure:

    mount -o remount,rw /

    Then do this

    chmod 640 /etc/shadow

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*