Linux/chpasswd
< Linux
echo 'pi:newpassword' | sudo chpasswd # change user pi password to newpassword
ref: linux - Change Password Programmatically - Unix & Linux Stack Exchange - https://unix.stackexchange.com/questions/197448/change-password-programmatically