I want to auto set the user password. For example I want to set the password for a no-root user to a value stored somewhere else in the script.
I am doing the following:
echo $input | passwd $user
However it fails since there is a prompt for Retype the new password.
I tried:
echo $input | passwd $user
echo $input | Retype New Password:
with no luck. It says password change aborted. How do I accomplish this? Does calling out for retyping a new password invokes another shell process?