Linux – Maximum number of groups in Linux

groupslinux

I have several questions about linux groups

  1. Is there a limit to the number of groups a user can create?
  2. Is there a limit to the total number of groups in a system?
  3. Is there a limit to the number of groups a user may be a member of?
  4. Do large numbers of groups (and users as well) degrade performance? Will 1000 users with 1000 groups each be substantially slower than 1 user and no groups (discluding system generated users/groups)

I'm trying to come up with a website that bridges the gap between SQL user databses and actual linux users.

Best Answer

  1. Users can't create groups, only the superuser can. And the superuser can create up to the system maximum minus existing groups.

  2. Modern Linuxes have a 32-bit gid_t, so just short of 4.3e9.

  3. Depends completely on the NSS being used. I don't think the files NSS has a limit.

  4. Again, depends on the NSS. Using something like LDAP would be faster than files obviously.