# What is the maximum number of groups for a user

## msalerno

I have been digging around to try to find out what the magic number is.  I am working on an AD integrated linux solution for my company, and our AD is massive.  My ad account is a memeber of 120 groups.  I'm working with some pam/su/sudo stuff and I have a feeling that I'm running into a max groups issue.  Can someone let me know where to find the max groups setting?  I'm sure it's in an include, just not sure which.

Thanks

Could this be it?

 */usr/include/linux/limits.h wrote:*   

> #define NGROUPS_MAX    65536    /* supplemental group IDs are available */

 

----------

## Ant P.

IIRC the kernel uses 32 bits for user/group IDs by default. That define doesn't look like the problem, maybe it's something in PAM or its configuration?

----------

## msalerno

I don't believe that it's a GID/UID issue.  I actually got SUDO working with the AD groups, so something else must be going on.  I'm still curious to know how many groups can be assigned to 1 user.

Thanks

----------

## Mad Merlin

It depends on what cogs you have spinning. With NFSv3 you're limited to 16 groups: https://bugs.eclipse.org/bugs/show_bug.cgi?id=157931 but I'm not aware of another lowish limit.

----------

