Add new group "mygroup":
sudo groupadd mygroup
To view membership of a group:
sudo grep ^mygroup /etc/group
or
sudo getent group mygroup
The top command lists only the contents of the /etc/group file of local primary group membership. The secondary group associates are in /etc/passwd in field/column 4.
The second command displays the group mygroup's secondary memberships in /etc/passwd. It also returns secondary memberships in a domain (SAMBA) directory.
Add user to group:
sudo usermod -G mygroup newuser
List groups a user is a member:
sudo groups existingusernm
To review the Samba domain group mapping, if Samba is set-up via Samba 4's Active Directory:
sudo net groupmap list
Alternately, on Ubuntu, you can use the samba-tool:
sudo samba-tool group list
List all users
sudo getent passwd
previous page
|