David Coulson on 12 Nov 2011 11:45:30 -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/11 2:38 PM, JP Vossen wrote:
Since this is a Linux system, the primary group is the same as the user name, so that's no help.
Not sure I understand that connection - Your system creates a group with the same name of the user and sets the gid of the new user to that group? My RedHat systems seem to create users with gid 500 (users)

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.
Pretty sure if you just do 'usermod -aG group1,group2,blahblah username' it'll add the user to any group they are currently not a member. No need to figure out who is not a member of the group.

David
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug