I'm using busybox with a limited passwd (I don't have --stdin option) and without chpasswd and I need to change the password of an user from bash. Here is my best result:
echo newpassword > pwdfile
echo newpassword > pwdfile
cat pwdfile | passwd myuser
Changing password for myuser
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Bad password: too simple.
Warning: weak password (continuing).
Re-enter new password:
passwd: The password for myuser is unchanged.