I just made a silly mistake on my Ubuntu Server box: I added myself to a group using usermod -G
, after which I discovered the -a
option...
The result is that I am now out of the admin
group, and lost my sudo rights. I can sort that out, but I want to know what other groups I may been removed from? My user was the first one so what I'm looking for is a list of groups that the first user gets added to at installation time.
Michael's answer was the closest, but I wanted to be sure, so I installed a fresh copy of Ubuntu Server 8.04.2 (Hardy Heron) in a virtual machine to get the official group list. The installation was a basic one with no specific server roles selected. These are the first groups, assigned by default, to the first user:
To assign these groups to a given user, issue the following command:
The
-a
switch means "append" so that existing supplementary groups are not overwritten.To get a list of groups assigned to a particular user:
or for the current user:
From here, the default groups for the first user on an Ubuntu box are:
For Ubuntu 14.04 LTS:
$USERNAME adm cdrom sudo dip plugdev lpadmin sambashare
The default group should be the same as the user name. So if you created user1, his default group would be user1.
[Edit]
Here you have an explanation of the group memberships.
Ubuntu Server 9.10 (samba, openssh instaled)
$username, adm, dialout, cdrom, plugdev, sambashare, lpadmin, admin
Ubuntu 12.04 LTS:
$USERNAME adm disk cdrom sudo dip plugdev lpadmin sambashare