Ubuntu 11.04, adduser myuser: admin group is missing
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:
admin:x:120:myuser
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.
the sudo group should be used:
adduser myuser sudo