TrumanWong

chpasswd

Tool for updating user passwords in batches

Supplementary instructions

chpasswd command is a tool for updating user passwords in batches. It redirects the contents of a file to /etc/shadow.

grammar

chpasswd(options)

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.

Example

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.