Difference between revisions of "Lost Password"

From FreekiWiki
Jump to navigation Jump to search
Line 1: Line 1:
 +
The following applies to most linux boxen.  It can be used on an Ubuntu box (which has no root password) to recover the user password.
 +
 
Generally it is easiest if the adopter brings the box in, but alternatively you can walk the adopter through the following:
 
Generally it is easiest if the adopter brings the box in, but alternatively you can walk the adopter through the following:
  
Line 12: Line 14:
 
#enter "b" to continue the boot process
 
#enter "b" to continue the boot process
 
#the boot will go to a root prompt.  change the password at that point and reboot.
 
#the boot will go to a root prompt.  change the password at that point and reboot.
 +
 +
The password for a user account can also be changed at this point.
 +
passwd <username>
 +
  
 
See how insecure the box is if you have physical access to it?
 
See how insecure the box is if you have physical access to it?
 +
 +
  
 
==live CD method==
 
==live CD method==

Revision as of 17:04, 30 November 2006

The following applies to most linux boxen. It can be used on an Ubuntu box (which has no root password) to recover the user password.

Generally it is easiest if the adopter brings the box in, but alternatively you can walk the adopter through the following:

GRUB method

Edit the grub boot commands.

  1. start the computer booting up
  2. at the GRUB screen enter "e"
  3. edit the line starting with "kernel" by selecting that line and entering "e"
    1. change "ro" to "rw"
    2. add "init=/bin/bash" to the end
    3. enter to make the changes
  4. enter "b" to continue the boot process
  5. the boot will go to a root prompt. change the password at that point and reboot.

The password for a user account can also be changed at this point.

passwd <username>


See how insecure the box is if you have physical access to it?


live CD method

If the box does not use grub to boot, one can boot the box using a knoppix cd, a rescue floppy, or a Toms Root Boot disk, then login as root and proceed as above.

  1. "mount /dev/hda3 /mnt"
  2. "chroot /mnt"
  3. "passwd"
  4. change password
  5. "sync"
  6. reboot

The procedure can be used for distributions other than the freekbox2 or 3, but you first need to determine the name of the root partition for the mount command.