Server Fault is a question and answer site for system and network administrators. 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

Hi I'm trying to add myuser to sudoers after a fresh install with root account,

# adduser myuser admin 

which gives:

adduser: the group `admin' does not exist.

however this works:

# adduser myuser root

but it doesn't make myuser a sudoer.

Furthermore, /etc/sudoers does contain these lines:

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

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

but pretty strange -- the file /etc/group doesn't contain admin.

Should I just manually edit it and add something like:

share|improve this question
up vote 10 down vote accepted

use groupadd admin to add the group then you could run adduser myuser admin. However you may want to instead use usermod -G myuser,admin myuser to remove yourself from the root group. (instead of myuser,admin, list the exact list of groups your user should be a member of.

If you ever get tempted to edit /etc/group directly, please use the vigr command, which will make sure the syntax of the file is correct before committing changes.

share|improve this answer
Thanks @stew! worked like a magic! one thing i had to do is to logout and then login with myuser. – valk Dec 16 '11 at 19:42

the sudo group should be used:

adduser myuser sudo
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.