Resetting your systems root password may be a necessary step if you have forgotten it or have bought a used computer which you don't want to setup anew. Doing so without any installation medium saves you a blank CD and a bit of time.

To start, restart your computer and get to the GRUB menu by pressing Shift while booting. Point your cursor to the Recovery mode option:

Press e to edit the boot options. There, look for a line that looks like this: linux /boot/vmlinuz-3.2.0-18-generic root=UUID=b8b64ed1-ae94-43c6-92\d2-a19dfd9a727e ro recovery nomodeset:

The line will differ depending on your version and kernel but should have about the same syntax. Remove the last part of line which is ro recovery nomodeset and replace it with rw init=/bin/bash:

This will cause a command line to be opened on startup. Press F10 now to reboot the machine and get to the command line. Once you are there, enter:

/usr/sbin/usermod -p '!' root

(If you get an error by copying and pasting above command, try replacing the quotation marks.) Now reboot the machine and the root password should be reset. The changes you did to the boot options will also reset automatically, so you do not have to change them back.

Reset root password (Ubuntu Linux) without CD
Tagged on:                                 

14 thoughts on “Reset root password (Ubuntu Linux) without CD

    • Avatar
      December 10, 2013 at 11:28 am
      Permalink

      hey!! this one works well and is easy to use…

      Reply
    • Avatar
      December 30, 2013 at 8:19 pm
      Permalink

      You can just do passwd

      Reply
    • Avatar
      January 30, 2014 at 7:54 pm
      Permalink

      It worked for me on Ubuntu 13.10.
      Thank you.

      Reply
  • Avatar
    October 2, 2012 at 3:08 am
    Permalink

    Worked for me on Ubuntu 11.10 server x64

    Reply
  • Avatar
    November 1, 2012 at 11:49 am
    Permalink

    Only s… Nathing work
    Im lost ROOT pass in ubuntu 10.04

    Reply
  • Avatar
    November 18, 2012 at 3:41 pm
    Permalink

    Thanks, had to do passwd, but was able to get the shell.

    Reply
  • Avatar
    November 20, 2012 at 3:08 pm
    Permalink

    Thanks for the tip. One hint: If you’re using a KVM switch (like I was), the Shift-on-boot trick might not work. The Solution: just connect the keyboard *directly* to the system in question.

    Reply
  • Avatar
    November 25, 2012 at 1:32 am
    Permalink

    thanks! passwd worked for me too

    Reply
  • Avatar
    December 6, 2013 at 11:38 am
    Permalink

    OK its working, Thanks Very Much, Ivebeen using other methods but this was a key to succes.
    OK to działa, Dziękuję bardzo za podpowiedź, używałem innych metod ale to był klucz do sukcesu.

    Reply
  • Avatar
    May 20, 2014 at 8:55 am
    Permalink

    After doing the above mentioned process it is strucking at syscenter_do_call and here sroll and caps lock blinking continuosly

    Reply
  • Avatar
    May 23, 2014 at 12:33 pm
    Permalink

    My acer Chromebook c7 has a dual booting system as I have just downloaded Ubuntu 12.4.
    At the end of the download, I entered a password as requested which has not been taken by the machine. However, the administrative account has ***** as password which I never set. I am unable to access the “Administrator” account. How do I proceed? Thank you.

    Reply
  • Avatar
    August 29, 2014 at 12:02 pm
    Permalink

    It worked. Ubuntu 12.04 Precise Pangolin. Had to do passwd though. Thanks!

    Reply
  • Avatar
    December 4, 2014 at 3:30 pm
    Permalink

    as u have written above inmy grubmenu it is showing
    ro i915.modeset=1 quiet splash $vt_handoff $nomodeset

    so what to edit in the above case

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*