I’d like to encrypt a password, set it as a variable in a script and then pass the encrypted password to dscl to set a user’s password.
Like this:
[code]
#!/bin/bash
USER=username
PASSWD=encrypted_password_hash
dscl . -passwd /Users/$USER $PASSWD[/code]
Is this possible? I have googled this problem for hours now and have not found anything! I thought people out there where more paranoid 🙂
I have tried setting the output from:
[code]openssl passwd -1[/code]
[code]openssl passwd -1 -salt randomch[/code]
with no luck…
Is there any auth key type in the users record I have to append/set?
Comments are closed