Home » Questions » Computers [ Ask a new question ]

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

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

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.

Asked by: Guest | Views: 193
Total answers/comments: 3
bert [Entry]

"The specific answer seems to be:

up to 32 on a modern linux
except if you are accessing a file over nfs, in which case it is 16

...which explains our problem, we've recently crossed the 16-group boundary for some users."
bert [Entry]

"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.)"
bert [Entry]

"See Above .
You can get from sysconf the number of groups.
You can use simple python one-line to get the value.
python -c 'import os; print(hex(os.sysconf(""SC_NGROUPS_MAX"")))'"
"See Above .
You can get from sysconf the number of groups.
You can use simple python one-line to get the value.
python -c 'import os; print(hex(os.sysconf(""SC_NGROUPS_MAX"")))'"