recovery of password for root in Ubuntu 12.10

6,216

Ubuntu, by default, has no password for the user root.

If you locked yourself out of your system,

  1. select "recovery mode" in the grub boot menu, when starting your machine. If you don't see a boot menu, you may need to press Shift during a time window of a few seconds after BIOS stage.

    This gives you root access and the power to grant your regular user account its administrative privileges.

  2. Enable write access on /¹.

    mount -o remount,rw /
    
  3. Add admin to the groups of your account.

    usermod -a -G admin [account name]
    
  4. Reboot and everything should be back to normal.

¹ I'm not sure whether the recovery mode of Ubuntu 12.10 mounts the root file system or just the initramfs.

Share:
6,216

Related videos on Youtube

Snehasish Karmakar
Author by

Snehasish Karmakar

Updated on September 18, 2022

Comments

  • Snehasish Karmakar
    Snehasish Karmakar over 1 year

    I installed Ubuntu 12.10 on my 32-bit machine using Ubuntu installer and gave a password(and the account name was 'samsung') when prompted. Later I was able to use that password for logging in, locking-unlocking, authentication etc.(I guess that's because I was the administrator then). But now,I have changed the account type from "administrator" to "standard" by mistake and whenever it needs to authenticate during any process(like connecting to a wi-fi,unlocking my user account), it asks me to give the password for root, but unfortunately the same password is not working. Tasks other than authentication(like loging in etc.) is working fine. I have changed the password several times but with no solution. If I use 'sudo' in terminal,it says "samsung is not in the sudoers file. This incident will be reported." How can I regain control?

  • Snehasish Karmakar
    Snehasish Karmakar over 10 years
    I have tried this. If I write 'admin', it says 'admin' group not found(I have also tried some other variations like Admin,Administrator etc with same result). When I write 'root' instead. It says something like "cannot lock /dev/passwd; try again later." :(
  • David Foerster
    David Foerster over 10 years
    From what I remember the recovery mode mounts the root file system read-only. You need to remount it with write access as described in the edited answer.
  • Snehasish Karmakar
    Snehasish Karmakar over 10 years
    You are right. But, Ubuntu 12.10 has no group named "admin", instead, "sudo" works. Perhaps, "adm" also works.Now, can you tell me how I can change user name "samsung" to my name? :) I have changed the name by going into "User Accounts" via "System Settings",but it seems to have no effect! "samsung" is still there as group(!) as well as user.
  • David Foerster
    David Foerster over 10 years
    This is an entirely different question. Go on and open one! :-]