How Many Unix Groups Can A User Be A Member Of?

15

4

We've recently run into a situation at a group-happy site where some group memberships are not being picked up. I seem to remember that there is an upper limit to the number of groups that a user can be a member of.

While I am specifically interested in modern Linux systems, I also remember that for some older versions of some OSs that number is lower?

David Mackintosh

Posted 2009-08-20T17:19:35.410

Reputation: 3 728

Answers

19

The specific answer seems to be:

...which explains our problem, we've recently crossed the 16-group boundary for some users.

David Mackintosh

Posted 2009-08-20T17:19:35.410

Reputation: 3 728

1The 16 groups per user limit is part of the sunRPC mechanism used for NFS (<4?). See RFC1057 "9.2 UNIX Authentication" – ikrabbe – 2016-06-02T05:45:52.627

1link to nfs group limit is broken – Tagar – 2016-09-26T15:55:26.633

1Interesting, wasn't aware of that limitation. – theotherreceive – 2009-08-21T03:22:40.923

8

For Linux Kernel 2.6.3 and above the limit is 64k groups per user.

If you are using NFSv4 the limit is higher than 16, too. (not sure about exact numbers here)

Baarn

Posted 2009-08-20T17:19:35.410

Reputation: 6 096

4

Look for NGROUPS_MAX in limits.h to find the value on your system.

I think this is a tunable parameter in a modern Linux kernel. (Used to be 16 on Solaris, I don't know if they have fixed that yet.)

Richard Hoskins

Posted 2009-08-20T17:19:35.410

Reputation: 10 260

Just checked a Solaris 11 server, not it is not fixed there - still 16 :-( – Tagar – 2016-09-27T18:04:44.063

You can also use getconf NGROUPS_MAX to receive this value from a shell. – MaPePeR – 2018-10-31T07:47:54.990

1

You can overcome the 16 group limit for NFS on RHEL/CentOS/Fedora by updating the following setting in /etc/sysconfig/nfs:

RPCMOUNTDOPTS="--manage-gids"

foobrew

Posted 2009-08-20T17:19:35.410

Reputation: 111