14 September, 2013

Password Breaking and Grub Password

In this tutorial we'll talk about password breaking and grub password. Sometimes you do not remember the root password. On Linux, recovering root password can be done by booting Linux in a specific mode: single user mode.

This tutorial will show you how to boot Linux in single-user mode when using GRUB and finally how to change the root password.

In normal use, a Linux OS runs under runlevels between 2 and 5 corresponding to various multi-user modes. Booting Linux under runlevel 1 will allow one to enter a single-user mode, the mode of a specific user. At some level, you get a root prompt directly. From there, change the root password is a piece of cake.

Entering runlevel 1

Some Linux distributions, such as Ubuntu, for example, offers a specific entry in the start menu where it says “Recovery Mode“ or "single user mode". If this is the case, this menu, you can start the machine in single-user mode, you can continue with the next section. If you can read this part.

With GRUB, you can manually change the input of the proposed startup menu at boot time. To do this, when the GRUB menu list (you may have to press the ESC key first), follow these instructions:

   * use the arrows keys to select the boot entry you want to edit.
   * press e to edit the entry
   * use the arrows to go to the kernel line
   * press e to edit this entry
   * the end of the line to add a word    single
   * press Esc to return to the main menu
   * press b to boot the kernel

Start the kernel must as always (except for the graphical display can be used), and finally get a root system (sh #).

Here we have access to the root file system, we finally change the password.

Change the root password

As root, while change the password does not require the old password, then run the command:

[root@linuxguide ]# passwd

you are prompted to enter your new password and ask you to confirm to ensure there are no typo.

Well, now you can reboot your box and gain root access again.


There is another way to break the GRUB boot password, follow these steps:

Step-1 Boot the system using the first CD of Linux. At the prompt, type: linux rescue to enter rescue mode. In rescue mode you will be asked whether to respect the similar measures to be followed in the installation. Once appeared the # prompt, type the following command:

[root@linuxguide ]# chroot /mnt/sysimage

Step-2 Edit the grub.conf file and remove the line in the passwd file. Save the file and exit.

Step-3 Once your machine restarts, you will be able to start your Linux operating system with standard.

No comments:

Post a Comment