0

I'm afraid I locked myself out of the sudo/root options. The one account that had sudo rights now reports that it doesn't have these anymore. How can I restore this? Do I need to use a live stick?

SPRBRN
  • 2,535

2 Answers2

0
  1. Drop into the root shell as described here.
  2. Change the root password by giving the command passwd root
  3. Change the passwords of the other users by the command passwd username
Naveen
  • 9,551
0

No sudo rights for your user can be caused due to multiple reasons.

I suggest trying Naveen's answer first, but in some cases dropping to the root shell doesn't work (for instance, you get the message "Give root password for maintenance").

In the latter case, you should try booting an Ubuntu Live CD, and mount the partition that contains your Ubuntu filesystem and you should chroot to your root filesystem.

In the case your user isn't part anymore of the sudo group (you can check this by issuing groups <username> from your terminal), you'll have to re-add your user to the sudo group:

adduser <username> sudo,

Also make sure the /etc/sudoers file contains the following entry for the sudo group:

%sudo ALL=(ALL:ALL) ALL

This website shows the first part of this procedure in more detail

Zebaz
  • 156