It is very common that some times we just don't seem to find the thing that we need the most, or for that matter we can't remember what we need. And just in case that you can't remember your root password for your Linux system. I think I can help you with it.

To start off, you need to restart you computer and get to GRUB(the boot loader). Once you have done this. Do as follows

  • Select the line which refers to the Linux kernel and press 'e'
  • Then select the line which refers to the kernel of your system and press 'e' again.
  • Now you should be at a GRUB prompt. Goto the end of the line and type 'single'.
  • Then hit enter. You should be back to the previous screen.
  • Goto the first line and press 'b'.
  • Your Linux system will now boot. You will get a shell prompt.
  • type "vi /etc/shadow".
  • You will get a file in which all passwords are stored. You have to be careful here. All File entries will be of form.
    user name:encrypted password:etc....
  • Your interest should be with the first two fields.
  • Search the user name field for "root"
  • move the cursor to the second field and clear the encrypted password. So that your entry looks like.
    user name::etc...
  • Save the file and quit vi.
  • Reboot the computer and login as root, you won't be asked for a password. Now you can use 'passwd' and change the root password to something appropriate.

I hope that has helped you. No, this is not a security bug as this can be done only on the computer when you have to be present in front of the computer and it has to boot up in front of you.