Encrypt password in new user script
I'm building a script that creates a new user, but I have not been able to solve how to generate an encrypted password, put this in the script and let dscl set the password (encrypted) for the user.
I don't want to put the password in clear text inside the script.
In Ubuntu you can do it like this:
Encrypt the password:
+mkpasswd -s <password>+
Set encrypted passwd:
+usermod -p <encrypted_passwd> <user_name>+
But in Mac OS X, there exist no "mkpasswd" or "usermod" so my question is if anyone knows how to solve this problem?
MBP Rev A, Mac OS X (10.6.2)