You can find out to what groups a user belongs.
To find out what groups someone belongs to, use the groups command . For example, if I wanted to know what groups I belong to, I could run the groups command with no arguments:
% groups
ora staff book dmgI belong to the groups ora, staff, book, and dmg.
To find out the groups that another user belongs to, type their login name as an argument to the groups command:
% groups frank
frank: ora prod editors bookOn some systems (BSD-based systems), you belong to all your groups all the time. That is, Frank can access a file that belongs to prod and then another file that belongs to editors without having to change anything. On other systems, you can only belong to one group at a time, and you have to use the newgrp command to change groups (and possibly also type in a password for the new group).
Only the system administrator can add or delete users from a group.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access