The first step is to determine the user's hash ID. Password hashes are stored in the /var/db/shadow/hash directory. To see the hash IDs for all users, you can use the dscl command as root: dscl . -list /Users GeneratedUID
You will see a list of all "short" names for users and their hash IDs. |
Make a backup, preferably outside of this directory, of both files. Now, remove them both from the hash directory. The user will now have no password, but they system still thinks they do, so you will not be able to log in with a blank password.
Change the user's password to something temporary by using passwd drsavoye. Now, you will be able to log in to their desktop with the password you chose. In later versions of OS X you may be prompted to reset or delete their keychain file -- "Cancel" or close the dialog, as you want the keychain to still use the old password.
When finished, log the user out first and restore the copies of the files you deleted back into the hash directory.
Read Full Post