Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally removed my user from some groups yesterday because of some virtualbox issues and today I couldn't use sudo to do anything and had to use a livecd to edit sudoers.

Anyway I want to edit the user to be in the same groups it would be in the default installation but I don't which groups to add the user to.

share|improve this question
up vote 5 down vote accepted

Apart from your user's group, you are in

adm dialout cdrom plugdev lpadmin admin sambashare

/etc/sudoers should look like this:

# This file MUST be edited with the 'visudo' command as root.
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
# See the man page for details on how to write a sudoers file.
Defaults    env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

#includedir /etc/sudoers.d
share|improve this answer

Here's what I'm a member of and I haven't changed anything since install:

wojox@wojox-desktop:~$ groups
wojox adm dialout cdrom plugdev lpadmin admin sambashare

Just change wojox for your user name.

share|improve this answer

Your Answer


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.