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.
50
51       -s, --sha-rounds
52           Use the specified number of rounds to encrypt the passwords.
53
54           The value 0 means that the system will choose the default number of
55           rounds for the crypt method (5000).
56
57           A minimal value of 1000 and a maximal value of 999,999,999 will be
58           enforced.
59
60           You can only use this option with the SHA256 or SHA512 crypt
61           method.
62
63           By default, the number of rounds is defined by the
64           SHA_CRYPT_MIN_ROUNDS and SHA_CRYPT_MAX_ROUNDS variables in
65           /etc/login.defs.
66

CAVEATS

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

CONFIGURATION

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

FILES

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

SEE ALSO

151       gpasswd(1), groupadd(8), login.defs(5).
152
153
154
155shadow-utils 4.11.1               02/10/2022                      CHGPASSWD(8)
Impressum