JP Vossen on 12 Nov 2011 11:39:08 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Finding a /etc/group entry containing a user list

On 11/12/2011 02:30 PM, David Coulson wrote:
Just run 'id' against each username and parse out the output. Remember
/etc/group is typically just for supplemental groups - The user's
primary group is usually only in /etc/passwd.

Since this is a Linux system, the primary group is the same as the user name, so that's no help.

I'd forgotten about the 'id' command, thanks for the reminder. But I'm not sure I see how that helps me; it seems like I'd still need to parse stuff into some kind of data structure so I can get my answer.

Maybe I need an example.

If I have user01 to user10 (decimal, not binary :), and group01 to group40, I want to know that, say, group15 contains 8 out of 10 of my users, so if I can add user09 and user10 to group15, everyone will have the right perms once I chgrp the dir tree.

Of course, the flip side is that other users in group15 will have perms they don't need. I don't really care too much for this purpose, but usually that would matter. So maybe this question is less useful than I thought at first and yet-another-group really is the best answer.

JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --