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.
79
80 Note: this parameter overrides the MD5_CRYPT_ENAB variable.
81
82 MAX_MEMBERS_PER_GROUP (number)
83 Maximum members per group entry. When the maximum is reached, a new
84 group entry (line) is started in /etc/group (with the same name,
85 same password, and same GID).
86
87 The default value is 0, meaning that there are no limits in the
88 number of members in a group.
89
90 This feature (split group) permits to limit the length of lines in
91 the group file. This is useful to make sure that lines for NIS
92 groups are not larger than 1024 characters.
93
94 If you need to enforce such limit, you can use 25.
95
96 Note: split groups may not be supported by all tools (even in the
97 Shadow toolsuite). You should not use this variable unless you
98 really need it.
99
100 MD5_CRYPT_ENAB (boolean)
101 Indicate if passwords must be encrypted using the MD5-based
102 algorithm. If set to yes, new passwords will be encrypted using the
103 MD5-based algorithm compatible with the one used by recent releases
104 of FreeBSD. It supports passwords of unlimited length and longer
105 salt strings. Set to no if you need to copy encrypted passwords to
106 other systems which don't understand the new algorithm. Default is
107 no.
108
109 This variable is superseded by the ENCRYPT_METHOD variable or by
110 any command line option used to configure the encryption algorithm.
111
112 This variable is deprecated. You should use ENCRYPT_METHOD.
113
114 SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number)
115 When ENCRYPT_METHOD is set to SHA256 or SHA512, this defines the
116 number of SHA rounds used by the encryption algorithm by default
117 (when the number of rounds is not specified on the command line).
118
119 With a lot of rounds, it is more difficult to brute forcing the
120 password. But note also that more CPU resources will be needed to
121 authenticate users.
122
123 If not specified, the libc will choose the default number of rounds
124 (5000).
125
126 The values must be inside the 1000-999,999,999 range.
127
128 If only one of the SHA_CRYPT_MIN_ROUNDS or SHA_CRYPT_MAX_ROUNDS
129 values is set, then this value will be used.
130
131 If SHA_CRYPT_MIN_ROUNDS > SHA_CRYPT_MAX_ROUNDS, the highest value
132 will be used.
133
135 /etc/group
136 Group account information.
137
138 /etc/gshadow
139 Secure group account information.
140
142 newgrp(1), groupadd(8), groupdel(8), groupmod(8), grpck(8), group(5),
143 gshadow(5).
144
145
146
147shadow-utils 4.8.1 11/16/2020 GPASSWD(1)