Why is Keychain behaving erratically

passwordpermission

I got my Mac back from a repair shop that recovered my files from a corrupted partition and then reinstalled Snow Leopard.

When I booted it up Keychain complained about my password. I know my old password but it said it was incorrect. I canceled and that logged me in. I went into Keychain Access and tried Preferences > Reset My Default Keychain. It asks for a new password, which I gave, but it responded that it was “incorrect” as well.

I am somehow able to unlock the login keychain with my original password. I clicked delete, but the message that popped up scared me, talking about deleting references and files or just references. I tried just references. It didn’t seem to do anything.

I right clicked and went to Change Password. It changes it, it accepted it, but it didn't work for future login attempts.

I try to change my account password. It won’t accept my original password as old password or the “new” one I tried to set before.

I ran Keychain First Aid. Here’s the red text:

User differs on ~/Library/Keychains/login.keychain, should be 501, owner is 502
Permissions incorrect on ~/Library/Keychains/login.keychain, should be -rw-r--r-- , they are -rwxr-xr-x 
Owner not corrected on ~/Library/Keychains/login.keychain, reason: The operation couldn’t be completed. Permission denied
Permissions not corrected on ~/Library/Keychains/login.keychain, reason: The operation couldn’t be completed. Operation not permitted

I went to Terminal to do some black magic. sudo didn’t like my passwords. Then Keychain pops up every few minutes to nag me.

Can anyone explain this?

Edit: Booted into single-user mode and tried to fix the permissions, and it doesn't nag me anymore, but now my desktop has gone back to the factory default and it says the login Keychain is missing/permission denied, so I still can't do any administrative tasks.

Edit 2: I can no longer troubleshoot this as I gave up and reinstalled OS X. Much more straightforward than messing around with permissions that were clearly botched beyond repair. Anyway, this should be closed.

Best Answer

Sounds like this was due to them creating a new user (502) and naming it the same as the old user, and copying all your old files in. The problem is that the new user account ID doesn't match the old user ID. What needed to be done was a chown -R 502 on your whole user directory. Too bad you started afresh. Sidenote: Trying to restore in this fashion almost never works well. Wipe the disk, re-install a good OS, and then restore from a TM or other backup if available. I've never had a problem using that method, but I've definitely had problems using the method you describe. Better luck next time.