Posted on 04-24-2018 05:36 AM
Hi all.
I'm looking for a script that requests the user to input his username and password. If possible the user should type the password twice and both should be compared.
Both values should be stored for a later local account creation e.g.
Does somebody have something at hand?
Posted on 04-24-2018 10:14 AM
Wouldn't this cause the users username and password to be sent in plain text. I am not sure that you really should do that. I would check with you network security team first.
Posted on 04-24-2018 10:20 AM
You could use something along the lines of...
#!/bin/sh
Username ="$(osascript -e 'Tell application "System Events" to display dialog "Enter your username:" default answer ""' -e 'text returned of result' 2>/dev/null)"
Password="$(osascript -e 'Tell application "System Events" to display dialog "Enter your password:" default answer ""' -e 'text returned of result' 2>/dev/null)"
Password2="$(osascript -e 'Tell application "System Events" to display dialog "Enter your password again:" default answer ""' -e 'text returned of result' 2>/dev/null)"
Then you would need add in the script how you want to output said answers. In the log? In a text file?
With that said this will send the information in plaintext and I highly suggest to NOT do that.
Posted on 04-24-2018 11:26 AM
Without knowing your situation or what you've researched so far - have you looked into NoMAD Login?
Posted on 04-24-2018 11:27 AM
This script has a similar method as already posted, and also uses the "hidden answer" option and passes it to an expect block for later use. As @ammonsc mentioned, you'd definitely want to make sure this meets your security requirements:
https://github.com/JAMFSupport/FileVault2_Scripts/blob/master/reissueKey.sh
Posted on 04-24-2018 09:59 PM
Thanks all...
I'm aware of the password been passed in plain text or been used within the script in plain text.
We might look into another option to do this.