The Error
You open Chrome, Slack, or SSH Agent โ maybe just wake your Mac from sleep โ and this dialog appears:
The system was unable to unlock your login keychain.
You type your password. It keeps asking. Or it silently blocks the app from accessing credentials it needs. Either way, something is broken.
The cause is almost always a password mismatch: your keychain was encrypted with an old password, and your current login password is different. macOS can't auto-unlock at login.
Root Cause
macOS encrypts your login keychain using your account password at the time the keychain was created. When the two fall out of sync, the auto-unlock fails every time you log in.
Common triggers:
- An admin or Apple ID recovery reset your password without knowing the old one
- You changed your password in System Settings but the keychain wasn't updated โ common on FileVault-enabled or Apple Silicon Macs
- The keychain file is corrupted
- You migrated from another Mac; the keychain came along but the passwords never matched
Fix 1: Sync the Keychain Password to Your Current Login Password
Still remember your old password? This is the cleanest fix โ no data loss, five steps.
- Open Keychain Access (press
โ Space, type Keychain Access) - Go to Edit โ Change Password for Keychain "login"
- Enter your old password in the Current Password field
- Enter your new login password in both the New Password and Verify fields
- Click OK
Log out and back in. The popup should be gone.
Fix 2: Run Keychain First Aid
Older macOS versions include a built-in repair tool that resolves most password mismatches automatically.
- Open Keychain Access
- In the menu bar, go to Keychain Access โ Keychain First Aid
- Enter your current account password
- Select Repair, then click Start
Note: Apple removed Keychain First Aid in macOS Ventura (13.0). If it's not in your menu bar, skip to Fix 3.
Fix 3: Reset the Login Keychain
Old password forgotten, or the keychain file is corrupted? Reset it. Fair warning: you'll lose all stored passwords in that keychain. Export what you can before proceeding.
Export passwords first (if you can still access them)
- In Keychain Access, select the login keychain in the sidebar
- Select the items you want to keep, then go to File โ Export Items
- Save as
.p12with a passphrase you won't forget
Reset via Keychain Access
- Open Keychain Access
- Go to Preferences โ Reset My Default Keychains
- Confirm with your current password
A fresh login keychain is created, encrypted with your current password. Apps will ask for credentials again on next use โ that's expected.
Reset via Terminal
# Step 1: Back up the old keychain
mv ~/Library/Keychains/login.keychain-db ~/Library/Keychains/login.keychain-db.bak
# Step 2: Log out and back in โ macOS will create a new login keychain automatically
Don't delete the backup yet. Keep it around for a week in case you need to recover something from it.
Fix 4: Stop the Keychain from Locking Mid-Session
Keychain unlocks fine at login but keeps prompting throughout the day? The auto-lock timer is too aggressive.
- Open Keychain Access
- Right-click login in the sidebar โ Change Settings for Keychain "login"
- Uncheck Lock after X minutes of inactivity and Lock when sleeping
- Click Save
The keychain stays unlocked for your entire session. Good enough for most people on a personal Mac.
Fix 5: Check for Duplicate Keychain Files
Migrating from another Mac sometimes leaves behind stale keychain files that conflict with the active one.
ls -la ~/Library/Keychains/
A healthy system typically looks like this:
drwx------ 4 youruser staff 128 Mar 20 09:12 .
drwx--x--x 58 youruser staff 1856 Mar 20 09:00 ..
-rw------- 1 youruser staff 49152 Mar 20 09:12 login.keychain-db
drwx------ 1 youruser staff 128 Mar 20 09:12 [UUID-string]/
If you see extra .keychain-db files you don't recognize, move them off rather than deleting immediately:
# Move to Desktop first โ delete only after confirming everything works
mv ~/Library/Keychains/unknown-old.keychain-db ~/Desktop/
Verification
Once you've applied a fix, confirm it actually worked before calling it done.
- Go to Apple menu โ Log Out
- Log back in with your current password
- Open an app that previously triggered the prompt (Chrome and Slack are good test cases)
- No dialog = keychain is unlocking correctly at login
For a quick Terminal check:
# Returns "Keychain is accessible" if the login keychain is unlocked
security unlock-keychain ~/Library/Keychains/login.keychain-db && echo "Keychain is accessible"
Prevention
This error almost always traces back to a forced password reset โ someone forgot their password and used Apple ID recovery. The keychain never got updated.
- Always change passwords from inside macOS via System Settings โ Users & Groups โ Change Password. This path updates the keychain password in the same operation. Recovery mode and Apple ID reset do not.
- Keep a password record outside your Mac. If you're locked out of macOS, you're locked out of Keychain too. A secure note in a different password manager, or a hardware key, works well. Need a strong random password to start with? ToolCraft's Password Generator runs entirely in the browser โ nothing is sent to any server.
- After any Apple ID reset, run Fix 1 immediately โ before opening Chrome, Slack, or anything else that reads from Keychain. Do it while the mismatch is still fresh and your old password is still fresh in memory.

