Skip to main content

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"

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.


Sean beat me to it; use $3.


Thanks guys that worked!


If you use this script and already have a config profile for certain password requirements, will they work in tandem?