Fast/Best way to recover forgotten root linux password

  1. Select the kernel
  2. Press the e key to edit the entry
  3. Select second line (the line starting with the word kernel)
  4. Press the e key to edit kernel entry so that you can append single user mode
  5. Append the letter S (or word Single) to the end of the (kernel) line. If you are using an ubuntu linux distribution remove the words "ro quiet splash" at the end of the line and instead of it  add "rw init=/bin/bash"  
  6. Press ENTER key
  7. Now press the b key to boot the Linux kernel into single user mode
  8. At prompt type passwd command to reset password:

You need to mount at least / and other partitions:
# mount -t proc proc /proc    (not mandatory in ubuntu)
# mount -o remount,rw / (not mandatory in ubuntu)

Change the root password, enter:
# passwd
Finally reboot system:
# sync
# reboot

 NOTE: There are another ways to recover a password root. One of the most well knowed is to use a live CD, mount the partition where our target linux is installed edit file /etc/passwd and remove the x of the following line  "root:x:0:0:root:/root:/bin/bash" . With this action when we reboot the system we have the choice to login as root in system with an empty password. Maybe not in a graphical sessions but We can do it in the console.

If we want that grub menu will not be editable we can edit file /boot/grub/menu.lst there are a configuration line, I don’t remember wich,  that we can comment and our grub menu options will not be editable at boot.

7 thoughts on “Fast/Best way to recover forgotten root linux password”

  1. Pingback: best matcha
  2. Pingback: matcha australia
  3. Pingback: buy backlinks
  4. Pingback: click here

Leave a Reply

Your email address will not be published. Required fields are marked *