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 given GROUP gets changed to GID.

okay so important stuff here, bestie:

  • GID must be a non-negative decimal integer. and it must be unique, unless you use the -o option.
  • 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 GROUP have 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, or SYS_GID_MAX from /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 from GROUP to NEW_GROUP. rebranding era โœจ
  • -o, --non-unique โ€” when used with the -g option, 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 by crypt(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 the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. only absolute paths are supported. no SELINUX support.
  • -P, --prefix PREFIX_DIR โ€” apply changes in the PREFIX_DIR directory and use the configuration files from the PREFIX_DIR directory. 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 syntax
  • 3 โ€” E_BAD_ARG: invalid argument to option
  • 4 โ€” E_GID_IN_USE: group id already in use
  • 6 โ€” E_NOTFOUND: specified group doesn't exist
  • 9 โ€” E_NAME_IN_USE: group name already in use
  • 10 โ€” E_GRP_UPDATE: can't update group file
  • 11 โ€” E_CLEANUP_SERVICE: can't setup cleanup service
  • 12 โ€” E_PAM_USERNAME: can't determine your username for use with pam
  • 13 โ€” E_PAM_ERROR: pam returned an error, see syslog facility id groupmod for 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