[HPADM] RE: [HPUX] [SUMMARY] Adding many users to one group

From: Julius Szelagiewicz (julius@turtle.com)
Date: Thu May 29 2003 - 08:15:24 EDT


Dear Admins,
        I am posting full text of Bill Hassell's reply as a perfect
summary. I addition, there is a nice trick from Nick Stoker. The original
guestion was:
I need to add several hundred users to a group. From reading man
pages it follows that I have to add them on a single line in /etc/groups.
The LINE_MAX value in limits.h is 2048. What are my options?

On Wed, 28 May 2003, Bill Hassell wrote:
> It's really not documented very well, but you can repeat the group ID
> on multiple lines. I add about 10 usernames per line as in:
>
> mygroup::121:user1,user2,user3,user4,user5,user6,user7,user8,user9
> mygroup::121:user11,user12,user13,user14,user15,user16,user17,user18,user19
> mygroup::121:user21,user22,user23,user24,user25,user26,user27,user28,user29
>
> Verify functionality using the id command. Note that 10.20 (obsolete next
> month) requires a symlink to /etc/logingroup. Version 11 and higher are
> fine.
> Bill Hassell

And here is the Nick Stoker's trick:
One way round this is to have extra lines with different group names but
same group id, e.g. if main group is called staff and the gid was 110

you would have

staff::110:user1,user2,user3 etc...

and on another line have

staffsubgrp1::110:user4,user5,user6 etc.

If you do an 'id' on user4 it will come back with 'staff' and not
'staffgrp1'.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:30 EDT