Scenario / Questions
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
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.
Find below all possible solutions or suggestions for the above questions..
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)
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
-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:
From here, the default groups for the first user on an Ubuntu box are:
- $USERNAME (Primary)
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.
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
Kubernetes Free Online Tutorial, Kubernetes Beginner Tutorial
DevOps Free Online Tutorial, DevOps Beginner Tutorial
Ansible Free Online Tutorial, Ansible Beginner Tutorial
Docker Free Online Tutorial, Docker Beginner Tutorial
Openstack Free Online Tutorial, Openstack Beginner Tutorial
Disclaimer: This has been sourced from a third party syndicated feed through internet. We are not responsibility or liability for its dependability, trustworthiness, reliability and data of the text. We reserves the sole right to alter, delete or remove (without notice) the content in its absolute discretion for any reason whatsoever.