Thursday, November 11, 2010

How to reset root password in Ubuntu 10.04 LTS


In this how to we shall discuss how to reset root password in Ubuntu 10.04 LTS. I guess this howto will be of highly useful if you forgot your root password in Linux servers particularly in debian based systems like Ubuntu.

Single User Mode in Ubuntu 
To reset the root password you have to boot to single user mode. Follow to steps below to boot to the single user mode in Ubuntu 10.04 LTS.

Please note that Ubuntu 10.04 LTS use the GRUB 2 as bootloader. The first boot option will be used by GRUB 2 by default and it will be used for booting without waiting for user input. So you need to interrupt the boot process for getting boot menu.

To edit the boot menu in Ubuntu 10.04 LTS
For that press down the "shift" key while booting and you will get the GRUB boot menu.

Normally the top GRUB entry will be pointing to your normal boot entries. It will look similar to:

            Ubuntu, with Linux ( kernel version + options)

Press the 'e' key to edit the kernel parameters.

Now what you see are the boot entries. Now find the kernel line and append "init=/bin/bash" to it.

The kernel line will look like:
            linux root=UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx ro vga=794 quiet splash

Go to the end of the line using your arrow keys and append init=/bin/bash to it as follows:

            linux root=UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx ro vga=794 quiet splash init=/bin/bash

Now boot with the edited kernel parameter by pressing ctrl+x.

Your machine will now do a one time boot into single user mode. Once you reboot the changes you just made to Grub will be reverted.

Remount root partition as read/write in single user mode and reset password
Now your /root partition will be mounted as read only. Type in the following command to mount the /root partition as read write.

             mount -n -o remount,rw /

Now changing the root password is a piece of cake!!! just type in:

             passwd root

And specify the new password.

In newer Ubuntu releases, you will UEFI supported entries also.

27 comments:

  1. can you help me with vodafone webbook ubuntu 10.04.1 LTS. I forgot my password

    ReplyDelete
    Replies
    1. Hello Rampai,

      Use the above said procedure itself for resetting the root password.

      Don't forget to interrupt the boot process by pressing the shift key while booting for going to single user mode.

      Jayakrishnan

      Delete
    2. I tried pressing the shift key while rebooting to get into single mode menu its not working how is this possible???

      Delete
    3. Hi,

      Your GRUB_TIMEOUT should be set to a very low value in /etc/default/grub file. Open the file /etc/default/grub using a privileged user and edit GRUB_TIMEOUT value to required time in Seconds, say

      GRUB_TIMEOUT=10

      The above line will give you 10 seconds to press the "Shift" key to interrupt the boot process.!!

      Hope this helps.

      JK

      Delete
    4. Thanks for that but the thing is the webbook is password protected its only half a month old its been used by one of the family memebers however she lost the admininstrator password to login,but when it boots up its says the name of the person and and "other" it has those 2 options I tried adding another user name and password but it keeps stating authentication failier we cannot access the webbook to set the grub because we don't know the pin for it its brand new 2 weeks old hardly used I'm not sure what to do right now but I need to use it urgently can someone help me to fix this issue???

      Delete
  2. I wouls really need help here please

    ReplyDelete
  3. The problem is I cannot even edit the grub settings cause I cannot get into the webbook we have no clue what the password is that's why we want to reset the entire thing its brand new we only used it once and forgot the password it keeps stating authentication failed,itried getting into single account mode using shift while rebooting its changing to a black screen with writing on it but changing back to the vodafone logo its not allowing me to do anything I can't get acess to the present account on it I can't edit the grub settings what do I do about this???

    ReplyDelete
    Replies
    1. Hello Clinton,

      I can understand from your above posts that you are able to access the GRUB Menu.

      Quote
      "I tried getting into single account mode using shift while rebooting its changing to a black screen with writing on it."

      But if you follow my blog correctly, you would be able to reset the password. You may try resetting the password of your User Account by using "passwd username" command. (At the end of my post I have mentioned command to reset password of user "root".

      However basic Linux knowledge is really needed here. You may also contact the Vendor for your default password for "root" account.

      Regards,
      Jayakrishnan

      Delete
    2. I tried getting into single mode but its not working,when I'm pressing shift on reboot its going into a black screen but not staying on it even though I press and hold the shift key down,its just changing back to the logo screen and going back to the accounts where it asks for passwords I tried every password possible its not working out what do I do??? I can't get the grub menu because the screen is not staying at that part even when shift is held down and there's no way I can acess a profile to get in and change the grub settings what do I do to resolve this issue??? I need this webbook resetted???

      Delete
    3. Resetting your Webbook seems to be a better option. Else give it to a service center to reset your password.

      Regards,
      Jk

      Delete
    4. Hi! Someone got a solution?? I have the very same problem. Please help.
      Vodafone Webbook On9. Ubuntu certified (Ubuntu v10.04)

      Delete
  4. I've tried to press "shift" nothing changed please guys help me.

    ReplyDelete
    Replies
    1. What is your OS Version dude !

      May be you should edit the following lines in your grub config file :: /etc/default/grub.

      GRUB_HIDDEN_TIMEOUT=10
      GRUB_HIDDEN_TIMEOUT_QUIET=false

      Then run # update-grub

      Hope this Helps.
      JK.

      Delete
  5. Sorry Mr Jayakrishnan,How can i know ma OS Version on my Laptop running Ubuntu OS

    ReplyDelete
    Replies
    1. Hi,

      You can check the Ubuntu version from file /etc/issue or /etc/issue.net.

      Eg.

      $ cat /etc/issue.net
      Ubuntu 10.04.1 LTS
      $

      JK

      Delete
  6. The Vodafone Webbook does not use Grub. It uses U-boot and a custom Ubuntu Lucid done by Canonical (lucid-charlotte). It has an Freescale iMX51 ARM CPU. In short - a bitch to fix the OS. I'm sitting with one now that cannot boot. Going to try to recompile the Kernel (using Linode's Ubuntu12.04) and add their U-boot version.

    ReplyDelete
    Replies
    1. Hi

      Did anyone come right with this? I'm sitting with the same issue. Trying to fix a friends Vodafone Webbook of which he forgot the password.
      It does not even allow one to enter the BIOS so that one can change the boot order to boot from USB or external CD/DVD.

      Thanks

      Delete
    2. Hi,

      Press Shift key continuously during the web-book is booting. However if the web book is designed not to enter the grub mode, you wont be able to access the same.. :-) . Going to Vodafone web book service center should be a way to reset password.

      Delete
  7. Did anyone figure something out? I've got the same problem. Can't do nothing unless I put the right password wich I can't remember.

    ReplyDelete
    Replies
    1. try the above options I have mentioned. If you are not able to fix it, I would suggest to go to the Vodafone store. !!

      Jk

      Delete
  8. Howdy! Would you mind if I share your blog with my twitter group?
    There's a lot of folks that I think would really enjoy your content.
    Please let me know. Many thanks

    Feel free to surf to my website

    ReplyDelete
  9. Hellow. I have Vodafone Webbook ON9, the owner of it passed away and left no trace of its password. I have been browsing the internet everyday trying all the tricks i find but failing. i am unable to enter grub menu, when i press Shift or Esc at start of the pc, it blinks continuosly until it gets to login screen. i press and hold the button immediately after i press the power button.

    I have tried using recovery mode with the button at the back, when i enter commands like

    chroot /mnt

    It says chroot: No file or directory

    pressing passwd says not found

    Anyone with a different solutions?

    ReplyDelete
  10. After pressing ctrl+X, does it take lot of time to boot? It has been showing a pink screen for a while

    ReplyDelete
    Replies
    1. You are supposed to take to single user mode. Try some other shell like /bin/sh.

      Delete
  11. How do I reset my password for 13.3?

    ReplyDelete