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:
- Boot a live cd/dvd and choose “Try Ubuntu”. Ubuntu may or may not mount your system disk.
- Click on Dash, and type run and open a terminal.
- If your disk is mounted skip to step 5 otherwise continue.
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.
- Next, still in terminal enter
gksudo gedit /media/disk/etc/groups
and find the line that looks like
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
save, reboot into your system and your admin privileges should be restored.