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:
#!/bin/bash
USER=username
PASSWD=encrypted_password_hash
dscl . -passwd /Users/$USER $PASSWD
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:
openssl passwd -1
openssl passwd -1 -salt randomch
with no luck…
Is there any auth key type in the users record I have to append/set?