Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I accidently removed my user name from most of the groups it belonged to. I indeed miswrote sudo usermod -aG agmenor agmenor by forgetting the -a option. I found this question to add myself back to the sudoers group, which I'll do at my next reboot.

But after that, what other groups should I also add my user to? I know it depends largely on the programs I have installed; for example I should belong to debian-tor if I have Vidalia installed. But what are, at least, the groups I should belong to as if I was on a fresh install?

For instance, on another machine, the command groups returns agmenor adm dialout cdrom plugdev lpadmin admin sambashare debian-tor.

share|improve this question

1 Answer 1

This happened to me 2 weeks ago :)

That's what I get for groups command:

groups
myuser adm lpadmin admin sambashare vboxusers

Here is where I documented my rescue: Restore lost admin group membership

Short description of steps:

Boot up from the LiveCD, it doesn’t have to be the latest distribution, and open a terminal:

sudo mount /dev/sda1/mnt
sudo chroot /mnt

Note: instead of sda1 you should use the partition on which your root is mounted. If you are not sure about it, check in Disk Utility application (the default one on your liveCD.

Locate the groups:

cd /mnt/etc

The file which holds the groups is simply called groups. But because you have recently changed this file with the wrong command, you need to check the backup file in order to determine which were your old groups, so that you can add them back. The backup file is groups-.

Now, you have 2 options to go forward. The first one is to manually edit the groups file to add your user against the groups (take the back-up file as an example). The second option is to simply re-add the groups to your user with the usermod command. This way you learn the right format of the command:

usermod -aG group user

Cheers

share|improve this answer
    
Great, vielen Dank. You should write your way of restoring the sudoers rights as an answer to the question I am linking to, that would be great. –  Agmenor Feb 24 '12 at 0:46
    
Enhanced the answer. Cheers. –  bioShark Feb 24 '12 at 8:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.