MacOS – Sierra stuck at login screen – password doesn’t work

macosopen-directory

This has happened to me twice in the past week. I put my MacBook Pro to sleep while my user account is logged in. When I return, I enter the correct password and it shakes, as if the password were wrong. I try several times, and get nowhere. So I force reboot, and then I am able to login again. Here are some relevant lines from the log right after the reboot. The opendirectory lines are repeated hundreds of times.

loginwindow: -[LWBuiltInScreenLockAuthLion verifyPassword] | ERROR | Verify password called with PAM auth set to YES, but pam handle == nil
opendirectoryd: Client: <private>, UID: 0, EUID: 501, GID: 20, EGID: 20
opendirectoryd: queuing request to connection - '<private>'
loginwindow: (libpam.2.dylib) in od_record_create(): failed: 13
loginwindow: (libpam.2.dylib) in od_record_create_cstring(): failed: 13
loginwindow: (libpam.2.dylib) in pam_sm_authenticate(): OpenDirectory - Unable to get user record.

This is running Sierra 10.12.6. Filevault is disabled. I also notice after the reboot, Spotlight is hogging CPU for several minutes, like it's rebuilding an index, but that might be a red herring, just caused by the reboot.

Best Answer

Try to reset your login password at first:

macOS Sierra: Reset a login password.

If the above didn't help, try to reset Nonvolatile Random-Access Memory and System Management Controller:

How to reset NVRAM or PRAM on your Mac.

How to reset the SMC on your Mac.

P.S. I experienced the same issue on Mac Mini with El Capital. Resetting PRAM and SMC helped me to fix it.