Operating System - HP-UX
1833332 Members
2988 Online
110051 Solutions
New Discussion

Having trouble to add a person to a group!

 
B. Jen
Contributor

Having trouble to add a person to a group!

I am trying to add a person into a group by using SAM. I am getting the following error message. "The entry in file ...... will be longer than the maximum size supported by the Network Information Service (NIS). Do you want to cintinue?" If I select "Yes", got another error message "No changes were made on this screen, so group "..." will not be modified"

Any suggestions? Thank you.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Having trouble to add a person to a group!

Shalom,

Check /var/adm/syslog/syslog.log

Your user may be in more groups than the OS supports and thats a hard limit that can not be changed.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sundar_7
Honored Contributor

Re: Having trouble to add a person to a group!

This could be because you have way too many users listed as the members of the group. I believe there is a limit (1024 ?) on the number of characters.

Try this from the commandline

# vi /etc/group
group:::user1,user2,.....................................usern
group:::
#

# id new_user_you_want_add
Learn What to do ,How to do and more importantly When to do ?
A. Clay Stephenson
Acclaimed Contributor

Re: Having trouble to add a person to a group!

This is perfectly normal and it means that the length of an entry in the group file will exceed 2048 characters (LINE_MAX as defined in limits.h). Bear in mind, that the vast majority of users do not need an entry in the group file (or map) to be a member of a group; all that is needed is that their GID be in their passwd entry. This will define their primary group. Only those users that need to be in multiple groups must be entered in the group file. If entered in multiple grouops then a user can change groups explicitly via the newgrp command or implicitly by linking /etc/group to /etc/logingroup.

You can probably fix your problem by simply removing the login's from a given group that are only members of their primary group.

If you must exceed 2048 characters then the workaround is to create multilple group entries which have different group names
but a common GID

e.g
disney::201:mickey,minnie,pluto,donald,goofy
disney2::201:huey,louie,dewey,scrooge
disney3::201:sneezy,sleepy,dopey,doc,grumpy,happy,bashful

Not that all 3 share a common GID but only the first group entry will actually be mapped by NIS; therefore, all of your users which must be members of multiple groups should be placed in the first group file entry.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Having trouble to add a person to a group!

This is perfectly normal and it means that the length of an entry in the group file will exceed 2048 characters (LINE_MAX as defined in limits.h). Bear in mind, that the vast majority of users do not need an entry in the group file (or map) to be a member of a group; all that is needed is that their GID be in their passwd entry. This will define their primary group. Only those users that need to be in multiple groups must be entered in the group file. If entered in multiple grouops then a user can change groups explicitly via the newgrp command or implicitly by linking /etc/group to /etc/logingroup.

You can probably fix your problem by simply removing the login's from a given group that are only members of their primary group.

If you must exceed 2048 characters then the workaround is to create multilple group entries which have different group names
but a common GID

e.g
disney::201:mickey,minnie,pluto,donald,goofy
disney2::201:huey,louie,dewey,scrooge
disney3::201:sneezy,sleepy,dopey,doc,grumpy,happy,bashful

Note that all 3 share a common GID but only the first group entry will actually be mapped by NIS; therefore, all of your users which must be members of multiple groups should be placed in the first group file entry.
If it ain't broke, I can fix that.