Administrator privilege lost on only admin account

Not sure how it happened but I lost admin privileges on my only user account. Of course admin privileges are required to recover and since Ubuntu has no root account there’s no straightforward way to recover. Here’s how:

  1. Boot a live cd/dvd and choose “Try Ubuntu”. Ubuntu may or may not mount your system disk.
  2. Click on Dash, and type run and open a terminal.
  3. If your disk is mounted skip to step 5 otherwise continue.
  4. enter:

    sudo mkdir /media/disk
    sudo mount /dev/sdxy /media/disk

    where sdxy is the location of your root partition. in my case it was sda1.

  5. Next, still in terminal enter

    gksudo gedit /media/disk/etc/groups

    and find the line that looks like

    admin:x:120:

    Note: The number 120 may be different on your system. Do not change it. Then, add your username at the end of the line so that you have

    admin:x:120:username

    save, reboot into your system and your admin privileges should be restored.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: