Howto reset root password on linux

Sample Image 

 Problem:

  I have forgot my Linux root password. How can I reset it ?
  

 

To reset root password on linux, you need to boot as single user mode or level 1. If you do not have access to your rack, simply use Remote Console to do this.

  1. Login to your remote console

  2. Reset/Reboot your server

  3. If you don't see either a LILO or GRUB boot screen, try hitting CTRL-X to get one

    1. If it's LILO, just type "linux single" and that should do it

    2. If GRUB, hit 'e", then select the "kernel" line, hit "e" again, and add " single" (or just " 1") to the end of the line. Press ENTER, and then "b" to boot

    3. Important: If your system still ask for root password to login please add "single init=/bin/bash" instead of "single"

  4. Type: mount -o remount,rw /

  5. Type: mount /proc

  6. Type: passwd root (and then type the new passwords)

  7. Type: sync

  8. Type: mount -n -o remount,ro /

  9. Reboot your server: /sbin/shutdown -rn now

  10. You are done!