GROUPMOD(8)
๐ GROUPMOD ๐
okay bestie, so groupmod is a System Management Command and it's literally the glow-up artist for your groups. let's get into it ๐
โจ NAME โจ
groupmod โ modify a group definition on the system ๐
๐ฆ SYNOPSIS ๐ฆ
groupmod [options] GROUP
๐ธ DESCRIPTION ๐ธ
So basically, groupmod modifies the definition of the GROUP you hand it, by editing the appropriate entry in the group database. that's it, that's the whole vibe. it's giving "makeover montage but for /etc/group" ๐
โจ OPTIONS โจ
these are the options that apply to the groupmod command, no cap:
-a,--appendโ if you're specifying group members with-U, this appends them to the existing member list instead of just replacing the whole thing. very "add to cart, don't empty the cart" energy ๐-g,--gid GIDโ the group ID of the givenGROUPgets changed toGID.
okay so important stuff here, bestie:
GIDmust be a non-negative decimal integer. and it must be unique, unless you use the-ooption.- users who use this group as their primary group will be updated so they keep it as their primary group. ๐ซถ
- any files that have the old group ID and need to keep belonging to
GROUPhave to have their group ID changed manually โ groupmod is not doing that for you, sorry. ๐ญ - no checks will be performed with regard to the
GID_MIN,GID_MAX,SYS_GID_MIN, orSYS_GID_MAXfrom/etc/login.defs.
-h,--helpโ display the help message and exit. the classic "what does anything do" button ๐-n,--new-name NEW_GROUPโ the name of the group changes fromGROUPtoNEW_GROUP. rebranding era โจ-o,--non-uniqueโ when used with the-goption, this allows you to change the group GID to a non-unique value. living dangerously, love that for you ๐-p,--password PASSWORDโ the encrypted password, as returned bycrypt(3).
note: this option is not recommended, because the password (or encrypted password) will be visible to users listing the processes. lowkey a privacy nightmare fr fr. ๐ฌ
you should make sure the password respects the system's password policy.
-R,--root CHROOT_DIRโ apply changes in theCHROOT_DIRdirectory and use the configuration files from theCHROOT_DIRdirectory. only absolute paths are supported. no SELINUX support.-P,--prefix PREFIX_DIRโ apply changes in thePREFIX_DIRdirectory and use the configuration files from thePREFIX_DIRdirectory. this option does not chroot, and it's intended for preparing a cross-compilation target. some limitations to know about: NIS and LDAP users/groups are not verified. PAM authentication is using the host files. no SELINUX support.-U,--usersโ a comma-separated list of usernames to add as members of the group. bestie lineup ๐ง
the default behavior (if the -g and -U options are not specified) is defined by the USERGROUPS_ENAB variable in /etc/login.defs.
๐ CONFIGURATION ๐
these configuration variables in /etc/login.defs change how this tool behaves:
MAX_MEMBERS_PER_GROUP (number)
Maximum members per group entry. when the maximum is reached, a new group entry (line) is started in /etc/group โ with the same name, same password, and same GID. it's giving "split the group chat when it gets too full" ๐ฌ
the default value is 0, meaning there are no limits in the number of members in a group.
this feature (split group) lets you limit the length of lines in the group file. it's useful for making sure lines for NIS groups are not larger than 1024 characters.
if you need to enforce such a 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, be careful. ๐ญ
๐ FILES ๐
/etc/groupโ group account information./etc/gshadowโ secure group account information./etc/login.defsโ shadow password suite configuration./etc/passwdโ user account information.
๐ EXIT VALUES ๐
the groupmod command exits with these values, so you can tell what went down:
0โE_SUCCESS: success ๐2โE_USAGE: invalid command syntax3โE_BAD_ARG: invalid argument to option4โE_GID_IN_USE: group id already in use6โE_NOTFOUND: specified group doesn't exist9โE_NAME_IN_USE: group name already in use10โE_GRP_UPDATE: can't update group file11โE_CLEANUP_SERVICE: can't setup cleanup service12โE_PAM_USERNAME: can't determine your username for use with pam13โE_PAM_ERROR: pam returned an error, see syslog facility idgroupmodfor the PAM error message
๐ SEE ALSO ๐
chfn(1), chsh(1), passwd(1), gpasswd(8), groupadd(8), groupdel(8), login.defs(5), useradd(8), userdel(8), usermod(8).
and that's the whole page bestie, we ate and left no crumbs ๐ซถ this one's from shadow-utils 4.20.0, dated 07/30/2026 โ go forth and modify those groups, main character ๐ โจ
๐ฆ where this page comes from
- arch rolling: shadow 4.20.0.arch1-1 ยท 0BSD AND BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms