1GPASSWD(1) User Commands GPASSWD(1)
2
3
4
6 gpasswd - administer /etc/group and /etc/gshadow
7
9 gpasswd [option] group
10
12 The gpasswd command is used to administer /etc/group, and /etc/gshadow.
13 Every group can have administrators, members and a password.
14
15 System administrators can use the -A option to define group
16 administrator(s) and the -M option to define members. They have all
17 rights of group administrators and members.
18
19 gpasswd called by a group administrator with a group name only prompts
20 for the new password of the group.
21
22 If a password is set the members can still use newgrp(1) without a
23 password, and non-members must supply the password.
24
25 Notes about group passwords
26 Group passwords are an inherent security problem since more than one
27 person is permitted to know the password. However, groups are a useful
28 tool for permitting co-operation between different users.
29
31 Except for the -A and -M options, the options cannot be combined.
32
33 The options which apply to the gpasswd command are:
34
35 -a, --add user
36 Add the user to the named group.
37
38 -d, --delete user
39 Remove the user from the named group.
40
41 -h, --help
42 Display help message and exit.
43
44 -Q, --root CHROOT_DIR
45 Apply changes in the CHROOT_DIR directory and use the configuration
46 files from the CHROOT_DIR directory.
47
48 -r, --remove-password
49 Remove the password from the named group. The group password will
50 be empty. Only group members will be allowed to use newgrp to join
51 the named group.
52
53 -R, --restrict
54 Restrict the access to the named group. The group password is set
55 to "!". Only group members with a password will be allowed to use
56 newgrp to join the named group.
57
58 -A, --administrators user,...
59 Set the list of administrative users.
60
61 -M, --members user,...
62 Set the list of group members.
63
65 This tool only operates on the /etc/group and /etc/gshadow files. Thus
66 you cannot change any NIS or LDAP group. This must be performed on the
67 corresponding server.
68
70 The following configuration variables in /etc/login.defs change the
71 behavior of this tool:
72
73 ENCRYPT_METHOD (string)
74 This defines the system default encryption algorithm for encrypting
75 passwords (if no algorithm are specified on the command line).
76
77 It can take one of these values: DES (default), MD5, SHA256,
78 SHA512. MD5 and DES should not be used for new hashes, see crypt(5)
79 for recommendations.
80
81 Note: this parameter overrides the MD5_CRYPT_ENAB variable.
82
83 MAX_MEMBERS_PER_GROUP (number)
84 Maximum members per group entry. When the maximum is reached, a new
85 group entry (line) is started in /etc/group (with the same name,
86 same password, and same GID).
87
88 The default value is 0, meaning that there are no limits in the
89 number of members in a group.
90
91 This feature (split group) permits to limit the length of lines in
92 the group file. This is useful to make sure that lines for NIS
93 groups are not larger than 1024 characters.
94
95 If you need to enforce such limit, you can use 25.
96
97 Note: split groups may not be supported by all tools (even in the
98 Shadow toolsuite). You should not use this variable unless you
99 really need it.
100
101 MD5_CRYPT_ENAB (boolean)
102 Indicate if passwords must be encrypted using the MD5-based
103 algorithm. If set to yes, new passwords will be encrypted using the
104 MD5-based algorithm compatible with the one used by recent releases
105 of FreeBSD. It supports passwords of unlimited length and longer
106 salt strings. Set to no if you need to copy encrypted passwords to
107 other systems which don't understand the new algorithm. Default is
108 no.
109
110 This variable is superseded by the ENCRYPT_METHOD variable or by
111 any command line option used to configure the encryption algorithm.
112
113 This variable is deprecated. You should use ENCRYPT_METHOD.
114
115 SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number)
116 When ENCRYPT_METHOD is set to SHA256 or SHA512, this defines the
117 number of SHA rounds used by the encryption algorithm by default
118 (when the number of rounds is not specified on the command line).
119
120 With a lot of rounds, it is more difficult to brute forcing the
121 password. But note also that more CPU resources will be needed to
122 authenticate users.
123
124 If not specified, the libc will choose the default number of rounds
125 (5000), which is orders of magnitude too low for modern hardware.
126
127 The values must be inside the 1000-999,999,999 range.
128
129 If only one of the SHA_CRYPT_MIN_ROUNDS or SHA_CRYPT_MAX_ROUNDS
130 values is set, then this value will be used.
131
132 If SHA_CRYPT_MIN_ROUNDS > SHA_CRYPT_MAX_ROUNDS, the highest value
133 will be used.
134
136 /etc/group
137 Group account information.
138
139 /etc/gshadow
140 Secure group account information.
141
143 newgrp(1), groupadd(8), groupdel(8), groupmod(8), grpck(8), group(5),
144 gshadow(5).
145
146
147
148shadow-utils 4.9 11/19/2021 GPASSWD(1)