MacOS – Keychain says “Access to this item is restricted” after upgrading to Lion

macospasswordpermission

I recently upgraded to Lion and since then I haven't been able to use Keychain to look at my stored passwords. When I click on the checkbox to show them it prompts me for my master password, then pops up a dialog that says "Access to this item is restricted".

Based on reading questions here and on other support sites, I've tried using the Keychain Access program's "Keychain First Aid" feature. It reports that there are no errors. I also used Disk Utility to Repair Disk Permissions, and this didn't fix the problem either.

I looked in ~/Library/Keychains/ and it looks like I do have owner permission to read and write the keychain file, and my main account is the owner.

Is there anything else I can try to fix this? I'd hate to lose my keychain passwords.

Update:

I also tried dragging my login.keychain file from Finder into Keychain Access, and had no luck. I tried some digging around in the security command line app as well, but have made no progress…

Update 2:

After trying all the suggestions I commented on here I was still getting this error, but then I did a software update, and rebooted, and now my keychain is working again. So, I have no idea what went wrong, but it is now fixed! I'll just pick an answer as accepted.

Best Answer

There are several reasons Keychain does this. Often it's because a new account that you might have switched to does not have the same/correct paths to Keychain that it used to. For starters try changing the main login password of your account; if that doesn't do anything try this in terminal:

$ sudo touch login.keychain
$ codesign -vvv /Applications/Utilities/Keychain\ Access.app

If you get an error such as:

/Applications/Utilities/Keychain Access.app: code or signature modified

then:

$ codesign -vvv /Applications/Utilities/Keychain\ Access.app

which should give you the response:

/Applications/Utilities/Keychain Access.app: valid on disk
/Applications/Utilities/Keychain Access.app: satisfies its Designated Requirement

Reboot.