Keychain password questions

I've gotten used to most of OS X since my slow, late conversion to it two years ago, but its security arrangements still drive me nuts. I don't need them. I have no security concerns about my Powerbook. No master password is set on it. I'm the only user, except on occasions when I set up a new user for test purposes and then delete it. I know the admin password for my usual account, obviously, though I've set the PB up to log me in automatically on startup.

But somehow I've lost track of the password for my keychain(s), which I thought was the same password. I don't really understand what a keychain is, to be honest, and whenever I'm prompted to enter my password for it, I have to cancel out of the dialog box because nothing I can think of to enter is correct. I live in dread that one of these days I'm going to have to know that darn password. So, these questions:

1. Can I set a new password for a keychain without knowing the old one?

2. If not, can I delete a keychain completely without knowing the password, and what am I likely to lose if I do so?

(I regret to say that I find the online Mac Help's information on keychains almost completely opaque. Maybe it's just my anxiety getting in the way.)

3. When I open Keychain Access and click "Show Keychains", two keychains appear: one with my username, which contains three certificates, three application passwords and an internet password; and another called system, which contains only my Airport network password. I've successfully deleted two or three entries that were outdated and superfluous from my user-account keychain, but I have no idea how much trouble I'd be in if I deleted all the rest. To add to my confusion, I get prompted for my admin password when I want to delete things from the keychain — not my keychain password. Can anybody point me toward a clear, cogent explanation of keychains and how to get them under my control instead of being at their mercy? Many thanks...

TiBook/1Ghz/512M; PTProG3/500MHz/768M, Mac OS X (10.3.9), film & flatbed scanners, projector, graphics tablet, laser & photo printers

Posted on May 23, 2007 12:43 PM

Reply
8 replies

May 23, 2007 1:32 PM in response to eww

Here are some references that may help:

http://docs.info.apple.com/article.html?artnum=106973

Reset Keychain Password: Assuming that you are using a recent build of OS X, go to /Applications/Utilities and launch the app called Keychain Access. Go to the Window pulldown menu and select "Keychain First Aid". Enter your password, set the radio button to "Repair", and click "Start".

Tutorial: Keychain issues; resolving

If you can't access your keychain, or forget your password If you can't get into your keychain file because you've forgotten your password or the keychain file appears to be corrupt, there are a couple of options.

First, if you've forgotten your password, you can use the "Keychain First Aid" utility to make the keychain password the same as the login password.

This can be accomplished via the following process:

Open Keychain Access (located in Applications/Utilities
Go to the "Keychain Access" menu and select "Preferences"
Click the "First Aid" tab
Make sure the "Synchronize login keychain password" box is checked
Close the Preferences window
Go to the "Keychain Access" menu and select "Keychain First Aid"
Enter your username and password
Click the "Repair" button
Another option is to completely delete your keychain then recreate it. This routine is useful if your keychain appears to be corrupt or otherwise inaccessible.

This can be accomplished as follows:

Launch Keychain Access (located in Applications/Utilities)
Click "Show Keychains" in the lower-left corner of the window.
Select the problematic keychain from the left-hand pane.
Navigate to the "File" menu and select "Delete Keychain '(name of keychain)'"
Check all options for deletion and press "OK"
Create a new keychain by going to the "File" menu, then "New" and selecting "New Keychain"
You can now make this keychain your default if you desire by selecting it, then going to the "File" menu and selecting "Make '(name of keychain)' Default"

Login as root and perform repair In some cases, problems with keychains can only be resolved when logged in as the root user.

First, enable a root user account, as detailed in Knowledge Base article #106290 (briefly: open NetInfo Manager, located in Applications/Utilities, click the lock and enter the administrator password, then select "Enable Root User" from the Security menu and follow on-screen instructions).

After enabling the root user, and logging in under this account, again open Keychain Access. First attempt repairs using Keychain First Aid, and failing that, delete then recreate the keychain as described above while logged in as root.

Persistently asked for stored passwords If you are persistently asked for passwords in various applications that you have specified should be remembered in a keychain, your "login" keychain may not be active for one reason or another.

Navigate to ~/Library/Keychains/ (this is the Library folder inside your user home folder). Find the file named "login.keychain" and double-click it.

Failing that, select the "login" keychain within the Keychain Access application and make sure it is the default keychain by going to the "File" menu and selecting "Make 'Login' Default"

Turn off Keychain synchronization in applications having problems If specific applications are experiencing issues when accessing password-protected material, Keychain may be to blame.

For example, it appears that in some cases, failures in .Mac synchronization transfers are linked to issues with Keychain.

If you are having problems synchronizing data with .Mac servers, you may want to try the following process:

Open System Preferences and access the .Mac pane
Click the "Sync" tab
Uncheck the "Synchronize with .Mac" checkbox
Close System Preferences
Re-open System Preferences and repeat steps 1 and 2
Re-check the "Synchronize with .Mac" checkbox
If the above process does not re-allow synchronization, you may need to leave Keychain synchronization turned off in the "Sync" tab of the .Mac System Preferences pane.

MacFixIt reader Faisal writes:

"I believe the problem may be related to Keychain sync overwriting or mangling the .Mac information in the Keychain. By disabling Keychain sync I seem to be able to sync again without issue."


A keychain is simply a secured database in which you can store userids and passwords securely. OS X integrates most applications to the Keychain so that when a userid and/or password is requested the Keychain fills in the information automatically unless you've elected otherwise. This is especially useful when accessing secure web sites so you don't have to remember every username and password you've assigned.

When you create a new account a new keychain file is created for that account. The account password is the default password used for the keychain so when you log into the account the associated keychain is opened automatically.

May 23, 2007 7:18 PM in response to Kappy

Kappy, thanks for the lengthy and very much on-point reply. My spirits rose immediately when I read:

First, if you've forgotten your password, you can use the "Keychain First Aid" utility to make the keychain password the same as the login password.


Unfortunately, when I run "Repair" in Keychain First Aid, it first prompts me for my login password password, then for the keychain password I don't have, and when I fail to produce the second password and cancel out of the passwrod-entry box, it gives me the following report:

"Repair started
Checking keychain configuration for <my longname> (user ID=501)
Home directory is /Users/<my shortname>
Checked login keychain
Checked password for ~/Library/Keychains/<my shortname>
Password for ~/Library/Keychains/<my shortname> is not the same as login password, so keychain can't be unlocked automatically
Login password could not be synchronized with keychain ~/Library/Keychains/<my shortname> (-128)
Unable to read settings for ~/Library/Keychains/<my shortname>
Checked default keychain
Checked keychain search list
Checked contents of ~/Library/Keychains/<my shortname>
Warning: some problems were not fixed
Repair failed"

So I'm still at square one. I should perhaps clarify that I have no .Mac account, so I have no keychain issue related to that.

I have no file called "login.keychain" anywhere on my computer, so the instructions that pertain to straightening out that file are inapplicable. My only keychain files are:

~/Library/Keychains/<myshortname>.keychain
and
hard drive/Library/Keychains/system.keychain

I guess I'll have to delete both keychains and start over. I quail at the thought, because I don't know what some of the items that remain in my keychains are for, where they came from, or where to find them again if I delete them. Nor do I understand why I have two keychains rather than just one, or whether I'll still need two keychains after deleting these. Since posting this afternoon, I've discovered that two of the certificates in one of my keychains had expired, so I deleted them; I also deleted a Skype password that I've never used. That keychain is now down to the following items:

my email account password — straightforward enough
NetServices (application password) — What is this?
Safari Forms Autofill (application password) — What is this?
Verisign Class 3 Code Sig Certificate — How will I replace this if I delete it?

May 23, 2007 8:00 PM in response to eww

Here's another suggestion:

Symptom: After applying an update or some kind of instance where a shutdown occurred, upon rebooting, Mac OS X will demand a password for System.keychain. No password will ever work, not even root.

NOW FOR THE SOLUTION...

WARNING: This assumes that you are competent with the command line AND you have a working copy of OS X somewhere else nearby, preferably on an external disk partition. I'm not going to explain the basics of using the Terminal or how to access both of your systems at the same time. If you are afraid of screwing up, simply reinstall Mac OS X and say a few prayers that it will fix itself (assuming that another Software Update won't mess it up again).

The problem lies with a file deep in the bowels of OS X. It's /var/db/SystemKey. What it does is that it tells Mac OS X how to unlock the system keychain. It only knows the System.keychain specific to the computer, so if you import another System.keychain as a replacement, SystemKey won't know how to unlock it and you'll keep getting the annoying dialogs prompting for System.keychain's password.

So without further ado, this is how to stop the annoying dialogs once and for all:

1. AS THE ROOT USER, you will need to copy over /var/db/SystemKey from a known good system to your problematic system. Make sure that you preserve the permissions (0400). It is advisable that you are NOT booted from your problematic system.

2. If you have a good System.keychain, copy that over to /Library/Keychains on the problem system. If you accidentally deleted System.keychain, you can execute the following (again AS ROOT):

/usr/sbin/systemkeychain -C -f

This creates a new, working, empty System.keychain and effectively overwrites the old keychain.

3. Reboot to your system. You will be presented with different, more familiar (Change, Change All) dialogs. If you had any passwords saved in your list of preferred networks, just put them back in.


I think you can go ahead and delete the .keychain file you found. The info I have pre-dates Tiger so there have likely been some changes.

May 23, 2007 9:41 PM in response to Kappy

Hi Kappy:
That's very informative.
Could you iron out a subtlety for me please.
If a single user sets up their OS with an account log in password and uses for e.g. Safari AutoFill to remember a web site log on, then that same account password is remembered by Keychain as the password to access keychain. My question is, if the User then changes their account log-in password, does the Keychain retain the older initial password and hence cause the difficulties that people experience?

ewe:
I am running panther as well, and I have two keychains, (auto generated)
HD/Library/Keychains/system.keychain (contents are indecipherable)
~/Library/Keychains/login.keychain (contents allude to mail and my ISP access)
and in Firefox, web names/passwords are kept in another location, not on the keychain.
That you had just .keychain is odd or perhaps it is because you have not used keychain to remember any login.

May 24, 2007 7:45 PM in response to Kappy

Well, I finally deleted both keychains, and I seem to be back in business, with Safari no longer prompting me every five minutes for a keychain password I don't know. I now have a new login.keychain in my user Library/Keychains folder. Maybe the old one called system.keychain was left over from Jaguar, since I used the Upgrade Install to get to Panther.

An interesting sidelight is that Keychain Access wasn't able to delete the keychains at all. I'd use it to delete them, and they'd still be there. I finally just trashed them from the folders they resided in, using the Finder. Keychain Access is completely useless, as far as I can tell.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Keychain password questions

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.