Recover Your Forgotten Password In Linux.

Just got another message, this time from Louis. A in Florida. He asks:

…I have kubuntu installed in my laptop computer, and everything was fine until yesterday, 4/6/08, when I was installing some additional programs from the settings menu. One of the updates that I installed created another user and also gave it admin control!!! It has now locked me out of signing into MY computer!!! Is there anyway that I can break into signing onto the system…

There are a couple approaches you can take.

1) Try to use the installation CD to gain root access.

If you don’t have the CD, Kubuntu CD downloads are here: Kubuntu Download CD and DVD Disk Images. Boot off the CD and use the command:

boot: rescue

Just follow the instructions after that (they will be on your monitor screen).

2) Try getting access without logging in. (I’ve not tried this, it’s still in my notes on a ‘to do’ list).

A lot of people have passwords set for users but not the boot (Grub) itself. Therefore, another method that might work is to boot the PC and if you don’t see the Grub menu, just press the ESC key. Use the arrow keys to select the kernel ‘(recovery mode)’ you want to boot and press enter. This should boot you in.

I should also add that it’s a simple matter to change your password on the command line. For example, if your username is louis, then change your password using this command:

passwd louis

Then it will ask you to enter a new password.

Hopefully this will help you and some other users in similar circumstances. :)

This entry was posted in Editorials, How To and tagged , , , , , . Bookmark the permalink.

5 Responses to Recover Your Forgotten Password In Linux.

  1. Tara says:

    Here is another: http://www.psychocats.net/ubuntu/resetpassword
    But I do know the CD boot should work.

  2. dsh says:

    The bootcd always does the trick. More precisely you have to do ‘chroot’ and then passwd.It doesn’t have to be the same (that you have installed) distro’s bootcd. Just mount your root partition to a directory /mnt/XXX and then type “chroot /mnt/XXX /bin/bash”.

    It’s the well-known method for breaking into a machine that you have physical access to (usually for the purpose of nasty jokes).

    What’s more I think that the post is bad-titled. I clicked only because I thought – OMG – he writes how to decrypt /etc/shadow. In most linux/unix flavour passwords are salted and hashed what renders them virtually unrecoverable.

  3. BWhitU says:

    Yes, you can crack (/etc/shadow) passwords using john the ripper. It’s a brute force method and it does work: http://www.openwall.com/john/

    The decryption is one-way. Most systems use md5sum encryption which is a 1 way sum of the password.

    To use brute force, make sure you have a better diectionary than the defaults (special characters).

    Also, http://www.plain-text.info/ and there’s an interesting script here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/325204

  4. dsh says:

    I believe that Rainbow tables can’t crack salted passwords that easily. Correct me If I’m wrong.

    Also dictionary-based brute-force isn’t too effective when users choose strong passwords.

  5. @dsh – Thanks! :) “Recover ‘From’ Your Forgotten Password In Linux” might have been a bit more descriptive. ;)

    @ BWhitU – I think strong passwords would take too long to brute force as ‘dsh’ (above) rightly pointed out. Better to simply use the bootcd and change the password.

    Cheers! :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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=""> <strike> <strong>