Apple Keychain Permission Problem and Solution

Suddenly I got a new error message and could not add any items to my keychain. The error message also mentions something on file access…

”An error has occurred. Unable to add an item to the current keychain.” or in swedish ”Ett fel inträffade. Kunde inte lägga till ett objekt till den aktuella nyckelringen.”

The solution was nowhere to be found, but using the terminal, it can be fixed easily by setting the right permissions for the keychain. Somehow, it seems the permissions are wrong. I doubt they have changed, so most likely Apple changed something in Keychain access. But am I just guessing here…

$ cd Library/Keychains/
$ ls -l
total 232
-rw-r--r--  1 root  staff    27K  8 Dec 20:30 yourKeychainName.keychain
-rw-r--r--  1 yourUser   staff    86K 16 Jan 19:38 login.keychain
$ sudo chown yourUser yourKeychainName.keychain
Password:
$ ls -l
total 232
-rw-r--r--  1 yourUser staff    27K  8 Dec 20:30 yourKeychainName.keychain
-rw-r--r--  1 yourUser staff    86K 16 Jan 19:38 login.keychain
Now the keychain works as it should.

Lämna ett svar