[nmglug] dude, wheres my password?

js at jasonschaefer.com js at jasonschaefer.com
Wed Apr 13 10:35:06 PDT 2005


Joe

Another way to do this is get knoppix or other live distro.

1. boot it up

2. get to a shell

3. type "sudo bash"

4. type "fdisk -l" to see what partitions are available. You want to find the
partition that your OS uses as /

fdisk -l 

 Device    Boot       Start          End      Blocks   Id  System
/dev/hda1               1         130     1044193+  82  Linux swap
/dev/hda2   *         131        3445    26627737+  83  Linux

In this case /dev/hda2 is / because there are no other options and hda1 is swap.

5. mkdir /mnt/temp

6. mount /dev/hda2 /mnt/temp

7. nano /mnt/temp/etc/passwd (before I start a flamefest, you can use any text
editor (emacs, vi, etc) nano is easy for beginners)
If passwd does not exist you need to refer back to step 4 and try another
/dev/hda? in step 6. if you need to do this, type "umount /mnt/temp" first to
un-mount anything you may have mounted initially.

8. remove the "x" in this line: "root:x:0:0:root:/root:/bin/bash" and save (this
bypasses /etc/shadow passwords)

9. reboot into your os

10. login as root, press enter for password (there is no password now)

11. "nano /etc/passwd" put the "x" back, the one you removed in step 8

12. type "passwd" to reset your password.

Hope that helps.



Quoting "joe at highmayhem.com" <joe at highmayhem.com>:

> Hello,
> 
> Yeah, I'm that guy. I thought I knew it, I don't remember changing it, 
> but I can't log in as root with any password thats in my head. What can 
> I do? Can I change it to something new? Can I find out what it is?
> 
> What would you do?
> 
> Thanks,
> Joe
> 
> 
> _______________________________________________
> nmglug mailing list
> nmglug at nmglug.org
> http://www.nmglug.org/mailman/listinfo/nmglug
> 







More information about the nmglug mailing list