Follow these steps to reset the password when using GRUB:
* Reboot the system, and when you are at the selection prompt (See Fig. 2 below), highlight the line for Linux and press 'e'. You may only have 2 seconds to do this, so be quick.
* This will take you to another screen where you should select the entry that begins with 'kernel' and press 'e' again.
* Append ' single' to the end of that line (without the quotes). Make sure that there is a space between what's there and 'single'. If your system requires you to enter your root password to log into single-user mode, then append init=/bin/bash after 'single'. Hit 'Enter' to save the changes.
* Press 'b' to boot into Single User Mode.
* Once the system finishes booting, you will be logged in as root. Use passwd and choose a new password for root.
* Type reboot to reboot the system, and you can login with the new password you just selected.

GRUB boot screen
Fig. 2: GRUB Boot Screen
2.1.2 Reseting passwords by using a boot disk and editing the password file
This method is a little bit more complicated than the previous one and has a very high chance of success (assuming your filesystem is not encrypted and you didn't forget the password to decrypt it if it is). As before, get permission before you do this.
To start, you need a Linux boot disk or a rescue disk. (If you didn't create one when prompted during the installation then let this be a lesson for you.) You can use your installation CD as a rescue disk; most distros have an option to allow you to boot into rescue mode. With my Redhat Linux CD, I have to enter linux rescue to start the rescue mode. But this might be a bit different in each distro. You can also use a live linux CD like Knoppix or Gnoppix for system recovery. (Click here for a list of all the live Linux CD's). In this tutorial I will use Knoppix as my rescue CD but the process is almost the same for any rescue CD you might use.

No comments:
Post a Comment