Sunday, November 11, 2007

Forgot Linux ‘root’ password? How to reset?

I forgot the root password. How do I login now?

This is a common q
uestion asked by people especially if they didn’t boot their computer (with Linux) for a while. Here I am giving a way on how to reset root password from a Linux system.

Please note that you can not perform this remotely. You must be physically at the computer.
  • reboot the system
  • When you first start the computer, the GRUB screen appears. Select Linux that you want to boot into, but press the ‘e’ key instead of ‘Enter’ (to stop the grub).
  • Hit ‘e’ again and you will go to different screen
  • Select ‘kernel’ as choice, and hit ‘e’ on your key board.
  • Type ‘single’ (or 1 in some versions) to enter ‘single user’ mode and then enter ‘b’ to boot. ( now your system is in single user mode as root)
  • Now you can change the root password by using ‘passwd’ command
Now if you reboot the machine, you will be able to login with new changed password.

No comments: