GROUPMEMS(8)

๐Ÿ’– GROUPMEMS(8) โ€” like, the manual page for groupmems bestie ๐Ÿ’–

okay so you wanna know about groupmems? it lives in the System Management Commands corner of the manual, section 8, and it's genuinely one of the cutest little tools in the shadow suite. let's get into it ๐Ÿซถ


โœจ NAME โœจ

groupmems โ€” administer members of a user's primary group ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

groupmems -a user_name | -d user_name | [-g group_name] | -l | -p

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so groupmems is that girl who lets a user administer their own group membership list WITHOUT needing superuser privileges. no sudo, no root, no drama. she's for systems that set users up so they live in their own name-sake primary group โ€” think guest / guest, that kinda setup. iconic honestly ๐Ÿ’–

but bestie listen โ€” only the superuser, as administrator, can use groupmems to alter the memberships of other groups. your own group? fine. someone else's? not your business, respectfully ๐Ÿ™ˆ

๐Ÿ’… OPTIONS ๐Ÿ’…

the options that apply to the groupmems command are, in order, no skips, no cuts:

  • -a, --add user_name โ€” add a user to the group membership list โœจ
    • if the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.
  • -d, --delete user_name โ€” delete a user from the group membership list ๐Ÿ—‘๏ธ
    • if the /etc/gshadow file exist, the user will be removed from the list of members and administrators of the group.
    • if the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.
  • -g, --group group_name โ€” the superuser can specify which group membership list to modify ๐Ÿ‘‘
  • -h, --help โ€” display help message and exit ๐Ÿ†˜
  • -l, --list โ€” list the group membership list ๐Ÿ“‹
  • -p, --purge โ€” purge all users from the group membership list ๐Ÿงน
    • if the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.
  • -R, --root CHROOT_DIR โ€” apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. only absolute paths are supported. no SELINUX support. ๐Ÿšซ

๐ŸŽ€ SETUP ๐ŸŽ€

okay so on this operating system, the groupmems executable is not setuid, and regular users cannot use it to manipulate the membership of their own group. that's just how it is here, bestie ๐Ÿ˜ญ


๐ŸŒˆ CONFIGURATION ๐ŸŒˆ

these are the config variables in /etc/login.defs that change how this tool behaves:

MAX_MEMBERS_PER_GROUP (number) โญ

maximum members per group entry. when the max is reached, a new group entry (line) is started in /etc/group โ€” with the same name, same password, and same GID. same girl, new line ๐Ÿ’…

the default value is 0, meaning that there are no limits in the number of members in a group.

this feature (split group) permits to limit the length of lines in the group file. this is useful to make sure that lines for NIS groups are not larger than 1024 characters. lowkey a niche need but okay ๐Ÿ‘‘

if you need to enforce such limit, you can use 25.

Note: split groups may not be supported by all tools (even in the Shadow toolsuite). you should not use this variable unless you really need it. fr fr, don't touch it for fun ๐Ÿซฃ

๐Ÿ“ FILES ๐Ÿ“

  • /etc/group โ€” group account information ๐Ÿ“
  • /etc/gshadow โ€” secure group account information ๐Ÿ”

๐Ÿ’œ SEE ALSO ๐Ÿ’œ

chfn(1), chsh(1), passwd(1), groupadd(8), groupdel(8), useradd(8), userdel(8), usermod(8).


that's the whole page, bestie, no cap ๐Ÿงš

this little love letter to groupmems ships with shadow-utils 4.19.0, dated 04/29/2026 โ€” so if you're reading this, hi from the future, hope your group membership is exactly how you want it ๐Ÿ’–๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from