GPASSWD(1)
โจ GPASSWD โจ (that's section 1 of the manual bestie, user commands ๐ )
okay so real talk: gpasswd is the girl who runs the group chat. not like, your group chat โ the actual groups on your system. she's out here administering /etc/group and /etc/gshadow and she takes her job very seriously ๐ซถ
๐ธ NAME ๐ธ
gpasswd โ administer /etc/group and /etc/gshadow
๐ SYNOPSIS ๐
gpasswd [option] group
๐ DESCRIPTION ๐
The gpasswd command is used to administer /etc/group and /etc/gshadow. Every single group can have administrators, members and a password. like, every group is a little friend group with a group chat password, no cap ๐
System administrators can use the -A option to define group administrator(s) and the -M option to define members. And bestie, they have all the rights of group administrators and members. main character energy fr ๐
When gpasswd is called by a group administrator with a group name only, it prompts for the new password of the group. just the group name, nothing else, and it's gonna ask you for the password.
If a password is set, the members can still use newgrp(1) without a password, and non-members must supply the password. so the members get the VIP skip-the-line pass and everyone else has to say the magic word โจ
๐ Notes about group passwords ๐
Group passwords are an inherent security problem, since more than one person is permitted to know the password. yeah. that's just... the vibe. it's a shared secret and shared secrets are messy ๐
However, groups are a useful tool for permitting co-operation between different users. so like, it's a tradeoff, and it's genuinely useful, we're just being honest about the risk here.
๐ OPTIONS ๐
Except for the -A and -M options, the options cannot be combined. not negotiable, no stacking, pick one and commit ๐ซ
The options which apply to the gpasswd command are:
-a,--adduser โ Add the user to the named group. welcome to the group chat bestie ๐-d,--deleteuser โ Remove the user from the named group. it's giving exit interview ๐ญ-h,--helpโ Display help message and exit.-Q,--rootCHROOT_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. (absolute paths only, and SELINUX is not invited to this party)-r,--remove-passwordโ Remove the password from the named group. The group password will be empty. Only group members will be allowed to usenewgrpto join the named group.-R,--restrictโ Restrict the access to the named group. The group password is set to"!". Only group members with a password will be allowed to usenewgrpto join the named group.-A,--administratorsuser,... โ Set the list of administrative users.-M,--membersuser,... โ Set the list of group members.
โ ๏ธ CAVEATS โ ๏ธ
This tool only operates on the /etc/group and /etc/gshadow files. Thus you cannot change any NIS or LDAP group. That must be performed on the corresponding server. so if you're sitting there wondering why your LDAP group is not budging โ she literally cannot see it, she's local-only, periodt ๐ซ๐
๐ CONFIGURATION ๐
The following configuration variables in /etc/login.defs change the behavior of this tool:
ENCRYPT_METHOD (string)
This defines the system default encryption algorithm for encrypting passwords (if no algorithm is specified on the command line).
It can take one of these values: SHA256, SHA512 (default), YESCRYPT. See crypt(5) for recommendations.
Note: this only affects the generation of group passwords. The generation of user passwords is done by PAM and subject to the PAM configuration. It is recommended to set this variable consistently with the PAM configuration.
History: This variable is used by other programs, which may still default to unsafe algorithms such as DES. To avoid using unsafe algorithms, the variable should always be specified. like please specify it, do not leave it on read ๐
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).
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.
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.
SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number)
When ENCRYPT_METHOD is set to SHA256 or SHA512, this defines the number of SHA rounds used by the encryption algorithm by default (when the number of rounds is not specified on the command line).
With a lot of rounds, it is more difficult to brute force the password. But note also that more CPU resources will be needed to authenticate users. more rounds = more secure = more CPU = your machine is sweating ๐
If not specified, the libc will choose the default number of rounds (5000), which is orders of magnitude too low for modern hardware.
The values must be inside the 1000-999,999,999 range.
If only one of the SHA_CRYPT_MIN_ROUNDS or SHA_CRYPT_MAX_ROUNDS values is set, then this value will be used.
If SHA_CRYPT_MIN_ROUNDS > SHA_CRYPT_MAX_ROUNDS, the highest value will be used.
Note: this only affect the generation of group passwords. The generation of user passwords is done by PAM and subject to the PAM configuration. It is recommended to set this variable consistently with the PAM configuration.
๐๏ธ FILES ๐๏ธ
/etc/groupโ Group account information./etc/gshadowโ Secure group account information.
๐ SEE ALSO ๐
newgrp(1), groupadd(8), groupdel(8), groupmod(8), grpck(8), group(5), gshadow(5).
and that's the whole page bestie, you ate that ๐
this lil masterpiece is from shadow-utils 4.20.0, dated 07/30/2026 โ go forth and administer your groups responsibly, ily, mwah ๐๐ฆ
๐ฆ 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