Sunday, April 12, 2009

Hack Linux root password

When booting the workstation, the bootloader GRUB allows you time for selecting your operating system. On that screen, follow the following steps:

1 - Highlight/select the distro (Red Hat Linux) using the arrow keys.

2 - Press ‘e’ to edit the boot parameters for the distro.

3 - You will see some entries like the following ones:

root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img

3 - Highlight/select the line for the Kernel parameters. In the above example, it is the second line which is in bold. Press ‘e’ when you have selected it.

4 - Add ’single at the end of the line. Don’t forget to put a space between the last character and ’single’ or ‘1′. Example:

kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ single

5 - Press ‘Enter’ or ‘Return’ key for saving the changes and then ‘b’ for booting.

6 - Once the system boots and you arrive at the command line interface, use the passwd command to change the root password as below:

passwd root

7 - Follow the instructions to enter new password twice.

8 - Once done, type ‘reboot’ or ‘exit’ to boot again. The new password you set will now work.

Moral : Always keep a password for GRUB

No comments:

Post a Comment