Default groups assigned to the first user in Ubuntu Server 8.04?
Solution 1
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:
- $USERNAME (e.g. wayne) (primary group - the rest are supplementary groups)
- adm
- dialout
- cdrom
- floppy
- fuse
- audio
- dip
- video
- plugdev
- sambashare
- lpadmin
- admin
To assign these groups to a given user, issue the following command:
sudo usermod -a -G adm,dialout,cdrom,floppy,audio,dip,fuse,video,plugdev,scanner,sambashare,lpadmin,admin
The -a
switch means "append" so that existing supplementary groups are not overwritten.
To get a list of groups assigned to a particular user:
cat /etc/group | grep <username>
or for the current user:
groups
Solution 2
From here, the default groups for the first user on an Ubuntu box are:
- $USERNAME (Primary)
- adm
- dialout
- cdrom
- floppy
- audio
- dip
- video
- plugdev
- scanner
- netdev
- lpadmin
- powerdev
- admin
Solution 3
For Ubuntu 14.04 LTS:
$USERNAME adm cdrom sudo dip plugdev lpadmin sambashare
Solution 4
Ubuntu 12.04 LTS:
$USERNAME adm disk cdrom sudo dip plugdev lpadmin sambashare
Solution 5
Ubuntu Server 9.10 (samba, openssh instaled)
$username, adm, dialout, cdrom, plugdev, sambashare, lpadmin, admin
Related videos on Youtube
![Wayne Koorts](https://i.stack.imgur.com/o7LtJ.jpg?s=256&g=1)
Wayne Koorts
Software developer who loves learning new technologies. My (mostly) programming blog can be found here. How to be a nice editor on Stack Exchange.
Updated on September 17, 2022Comments
-
Wayne Koorts almost 2 years
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.-
stackprotector over 2 yearsFor different Ubuntu versions: Default groups for user in Ubuntu?
-
-
Wayne Koorts about 15 yearsSo just admin and the username? Is that all for sure?
-
ehogue about 15 yearsOn a standard install that's all there is. At work we use Fedora and I know for sure that's all there is. And on my Ubuntu box here I only have my username and adm that I added after.
-
Michael Havas about 15 yearsI forgot to mention that I don't have an Ubuntu box to verify this or know what version of Ubuntu these default groups belong to. It's a good starting point though.
-
jldugger about 15 yearsThat guy's book is based on Ubuntu 7.10. Probably you have something different.
-
ehogue about 15 yearsYou're right. here are the groups I have on my desktop at the office: username adm dialout cdrom plugdev lpadmin admin sambashare dev . It looks like I killed all the groups on my home box. I probably forgot the -a on a usermod too. I do that all the time, but usually I print out the groups I have before the usermod to be able repair any screw up I might make.
-
ehogue about 15 yearsTo get the groups of a user you can also do: groups <username>
-
HopelessN00b about 10 yearsExact same as for Ubuntu 12.04 LTS, (which is in another answer), by the way.
-
John Indra about 10 yearsExact same? The answer for Ubuntu 12.04 LTS has "disk". There is no "disk" in my Ubuntu 14.04 LTS setup. Even if it's the exact same, I don't see providing the info as doing any harm :)