Saturday, November 8, 2008

forgot root password

I forgot root password.How can I retrieve it?

Restart your system

When the grub screen appears, where OS label entry is displayed like,RED HAT,Ubuntu,BOSS etc. then select your linux and press 'e' to edit.

Now, another screen appears, where you can see the lines like root(hd0,x) ,kernel ,initrd etc.

  • select kernel parameter line, (2nd line) using arrow keys and press 'e' key again and go to the end of the line and type the following there

init=/bin/sh

  • Now press 'b' key to boot
  • this boots u into the minimal mode
  • after it boots up, you will come to a screen where a prompt like sh#
  • here, Give the following commands

Give the following commands

#mount -n -o remount,rw /

#mount -avt nonfs,noproc,nosmbfs

#passwd
enter new passwd:xxxxxx
Reenter new passwd:xxxxxx


Reboot the system .

No comments: