usermod passwd

I am building a post deployment script where i add a series of standard users and want to set them with a default password for each. I am attempting to do this via the usermod command, which was successful in doing on RHEL, using the encrypted password. Obviously encryption is working differently and i could use some direction on how others may approach this.


Is it not working? If so, how? How exactly does your script work with
regard to the original password? If you are actually using the original
password somewhere and feeding it to usermod after going through a crypt
function (vs. having only the crypt’d version all along) you could use the
passwd command instead directly which would also let you use the system’s
default function by default:


echo newPasswordHere | passwd --stdin username

Good luck.