Tool for updating user passwords in batches
chpasswd command is a tool for updating user passwords in batches. It redirects the contents of a file to /etc/shadow
.
chpasswd(options)
-e: The entered password is encrypted ciphertext;
-h: Display help information and exit;
-m: Use MD5 encryption instead of DES encryption when the supported password is not encrypted.
First create a file corresponding to the user password in the format of username:password
, such as abc:abc123
. It must be written in this format and cannot have blank lines. Save it as a text file user.txt, and then execute the chpasswd command:
chpasswd < user.txt
The above is to use the chpasswd command to change passwords in batches. It is a shortcut in Linux system management.