Change your Password Without Logging In

This is not a how to for possibly hacking some one else’s computer, but how to fix your own computer if you forget your password.  This only works on Linux, and I don’t know if windows has an option to do this.  However, if you really can’t figure out your password on your windows machine you can get a friend to burn you a livecd of Fedora, Knoppix, or whatever flavor of Linux your prefer, and then you can use it to mount your ntfs partition with the mount command.  From there backup all your files, and when your done reinstall windows.  Sorry but that’s all I can think of for windows users.  You can also do this with a Linux machine.  Just use the mount command to mount an ext partition.  This isn’t really necessary though for Linux users.  There is a better route.

If you use Linux then reboot your computer.  When Fedora starts to boot hit a key to interrupt the boot process and edit vmlinuz.  Add the word ‘single’ to the end of the prompt and boot.  This will cause your computer to boot into single user mode.  A command prompt will come up, and you will not have to log in to use it.  To change your password use the ‘passwd’ command.

[root@localhost /]#  passwd brad
Changing password for user brad.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost /]#

You can also change your root password doing this as well.  At this point you may be wondering about security, and how you can prevent someone from changing your password.  First of all, there is no security guarantee if some one has your physical computer.  However, you can at least prevent the data on your computer from being read by encrypting your entire hard drive.  So what if you forget your Luks password to decrypt your hard drive?  Its simple you would be screwed so do not forget it.

If your interested in encrypting your hard drive, there is an option in Fedora 9 to encrypt the hard drive on anaconda, the tool used to install Fedora from a livecd or dvd.  When you select the partition layout just check the box to encrypt the hardrive.  I do not know if there is a way to do this or not without reinstalling.

4 Responses to “Change your Password Without Logging In”


  1. 1 rhamez July 15, 2008 at 1:25 PM

    nice one dude i was very desperete for it thnks a lot

  2. 2 a d sharpe August 30, 2008 at 6:40 AM

    Hey Brad –

    Let’s get a bootloader password on your boxes. And if memory serves, let’s start using LiLo which has a tougher password system.

    Also, keep WordPress updated since LinuxMint has been hacked twice recently through their blog.

    Neat article, however.

  3. 3 vasant Hegde October 31, 2008 at 7:33 AM

    is there a way to break Boot Loader’s password ??

  4. 4 bradlongo November 3, 2008 at 10:29 PM

    Not that I know of …. If you can get the encrypted password and you know the encryption method you can generate every single possible encrypted password and try to match one up :). There are about 61,474,519 possibilities for a 6 character password consisting of just letters and numbers (no symbols). So if you forgot the password for the boot loader good luck.


Leave a comment