1CHGPASSWD(8)              System Management Commands              CHGPASSWD(8)
2
3
4

NAME

6       chgpasswd - update group passwords in batch mode
7

SYNOPSIS

9       chgpasswd [options]
10

DESCRIPTION

12       The chgpasswd command reads a list of group name and password pairs
13       from standard input and uses this information to update a set of
14       existing groups. Each line is of the format:
15
16       group_name:password
17
18       By default the supplied password must be in clear-text, and is
19       encrypted by chgpasswd.
20
21       The default encryption algorithm can be defined for the system with the
22       ENCRYPT_METHOD variable of /etc/login.defs, and can be overwritten with
23       the -e, -m, or -c options.
24
25       This command is intended to be used in a large system environment where
26       many accounts are created at a single time.
27

OPTIONS

29       The options which apply to the chgpasswd command are:
30
31       -c, --crypt-method
32           Use the specified method to encrypt the passwords.
33
34           The available methods are DES, MD5, NONE, and SHA256 or SHA512 if
35           your libc support these methods.
36
37       -e, --encrypted
38           Supplied passwords are in encrypted form.
39
40       -h, --help
41           Display help message and exit.
42
43       -m, --md5
44           Use MD5 encryption instead of DES when the supplied passwords are
45           not encrypted.
46
47       -R, --root CHROOT_DIR
48           Apply changes in the CHROOT_DIR directory and use the configuration
49           files from the CHROOT_DIR directory. Only absolute paths are
50           supported.
51
52       -s, --sha-rounds
53           Use the specified number of rounds to encrypt the passwords.
54
55           The value 0 means that the system will choose the default number of
56           rounds for the crypt method (5000).
57
58           A minimal value of 1000 and a maximal value of 999,999,999 will be
59           enforced.
60
61           You can only use this option with the SHA256 or SHA512 crypt
62           method.
63
64           By default, the number of rounds is defined by the
65           SHA_CRYPT_MIN_ROUNDS and SHA_CRYPT_MAX_ROUNDS variables in
66           /etc/login.defs.
67

CAVEATS

69       Remember to set permissions or umask to prevent readability of
70       unencrypted files by other users.
71
72       You should make sure the passwords and the encryption method respect
73       the system's password policy.
74

CONFIGURATION

76       The following configuration variables in /etc/login.defs change the
77       behavior of this tool:
78
79       ENCRYPT_METHOD (string)
80           This defines the system default encryption algorithm for encrypting
81           passwords (if no algorithm are specified on the command line).
82
83           It can take one of these values: DES (default), MD5, SHA256,
84           SHA512. MD5 and DES should not be used for new hashes, see crypt(5)
85           for recommendations.
86
87           Note: this parameter overrides the MD5_CRYPT_ENAB variable.
88
89       MAX_MEMBERS_PER_GROUP (number)
90           Maximum members per group entry. When the maximum is reached, a new
91           group entry (line) is started in /etc/group (with the same name,
92           same password, and same GID).
93
94           The default value is 0, meaning that there are no limits in the
95           number of members in a group.
96
97           This feature (split group) permits to limit the length of lines in
98           the group file. This is useful to make sure that lines for NIS
99           groups are not larger than 1024 characters.
100
101           If you need to enforce such limit, you can use 25.
102
103           Note: split groups may not be supported by all tools (even in the
104           Shadow toolsuite). You should not use this variable unless you
105           really need it.
106
107       MD5_CRYPT_ENAB (boolean)
108           Indicate if passwords must be encrypted using the MD5-based
109           algorithm. If set to yes, new passwords will be encrypted using the
110           MD5-based algorithm compatible with the one used by recent releases
111           of FreeBSD. It supports passwords of unlimited length and longer
112           salt strings. Set to no if you need to copy encrypted passwords to
113           other systems which don't understand the new algorithm. Default is
114           no.
115
116           This variable is superseded by the ENCRYPT_METHOD variable or by
117           any command line option used to configure the encryption algorithm.
118
119           This variable is deprecated. You should use ENCRYPT_METHOD.
120
121       SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number)
122           When ENCRYPT_METHOD is set to SHA256 or SHA512, this defines the
123           number of SHA rounds used by the encryption algorithm by default
124           (when the number of rounds is not specified on the command line).
125
126           With a lot of rounds, it is more difficult to brute forcing the
127           password. But note also that more CPU resources will be needed to
128           authenticate users.
129
130           If not specified, the libc will choose the default number of rounds
131           (5000), which is orders of magnitude too low for modern hardware.
132
133           The values must be inside the 1000-999,999,999 range.
134
135           If only one of the SHA_CRYPT_MIN_ROUNDS or SHA_CRYPT_MAX_ROUNDS
136           values is set, then this value will be used.
137
138           If SHA_CRYPT_MIN_ROUNDS > SHA_CRYPT_MAX_ROUNDS, the highest value
139           will be used.
140

FILES

142       /etc/group
143           Group account information.
144
145       /etc/gshadow
146           Secure group account information.
147
148       /etc/login.defs
149           Shadow password suite configuration.
150

SEE ALSO

152       gpasswd(1), groupadd(8), login.defs(5).
153
154
155
156shadow-utils 4.12.3               11/29/2022                      CHGPASSWD(8)
Impressum