chpasswd
Change the passwords for multiple users by using stdin. tldr-pages
On Linux
Linux
Change the password for a specific user
printf "username:new_password" | sudo chpasswdIdentifyChange the passwords for multiple users (The input text must not contain any spaces.)
printf "username_1:new_password_1\nusername_2:new_password_2" | sudo chpasswdIdentifyChange the password for a specific user, and specify it in encrypted form
printf "username:new_encrypted_password" | sudo chpasswd --encryptedIdentifyChange the password for a specific user, and use a specific encryption for the stored password
printf "username:new_password" | sudo chpasswd --crypt-method NONEIdentify