PDA

View Full Version : usermod passwd



pzwqty
20-Feb-2013, 04:11
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.

Thanks
Mike

ab
20-Feb-2013, 06:44
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:

Code:
----------
echo newPasswordHere | passwd --stdin username
----------

Good luck.