Posted on 01-10-2013 12:14 PM
All,
I'm trying to create a script that is used as a logout/login hook to force the user to reset their password. I've been using the "newPasswordRequired=1" command and it seems to work ok locally, but when I try to use it via the JSS I get the following error: Script exit code: 139
Script result: /private/tmp/current.sh: line 5: 90168 Segmentation fault: 11 pwpolicy -u "$current" -setpolicy "newPasswordRequired=1"
Anyone have any ideas or recommendations for forcing local user password resets? Below is the script I'm trying to get to work.
#!/bin/bash
current=$( whoami )
pwpolicy -u "$current" -setpolicy "newPasswordRequired=1"
Solved! Go to Solution.
Posted on 01-10-2013 12:26 PM
If the script is being run through Casper, then the variable $3 will pass through the current user so
#!/bin/bash
pwpolicy -u $3 -setpolicy "newPasswordRequired=1"
would make it shorter and might solve it.
Posted on 01-10-2013 12:26 PM
If the script is being run through Casper, then the variable $3 will pass through the current user so
#!/bin/bash
pwpolicy -u $3 -setpolicy "newPasswordRequired=1"
would make it shorter and might solve it.
Posted on 01-10-2013 12:27 PM
Sean beat me to it; use $3.
Posted on 01-10-2013 01:37 PM
Thanks guys that worked!
Posted on 08-09-2016 08:37 AM
If you use this script and already have a config profile for certain password requirements, will they work in tandem?