Location: Fainted Brain

Discussion: Changing root password using GRUBReported This is a featured thread

Showing 1 post
CMG347
CMG347
Changing root password using GRUB
Jul 5 2009, 9:02 AM EDT | Post edited: Jul 5 2009, 9:02 AM EDT
If you have forgotten yhe root password of your Linux system, there is no need to panic! The fix is quite simple. Reboot your system. At the GRUB graphical menu, pres E to edit and add the following parameters to the kernel argument:

kernal /boot/vmlinux-2.6.2*-*-generic root=/dev/sda5 rw init=/bin/bash
Replacing 2.6.2*-* with your actual kernel version.
Type uname -r to find your kernel version. I.E. 2.6.28-11-generic

Here, byy appending the init=/bin/bash argument to the kernal line, we are telling linux to immediately enter a bash prompt after booting the kernel. You can now reset the root password using the passwd command, as follows.

bash # passwd

Now you may wonder that if it's so simple to reset the root password, then ordinary users can take advantage. But you can restrict it by using a password for the GRUB loader, so that unauthorized users can't reset the passwords.
1  out of 1 found this valuable. Do you?    
Keyword tags: grub hack linux password

Sign in to be the first to reply.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)