Monday, February 8, 2016

OSX Keychain Prompting for SSH key passphrase even after saving it.

From StackExchange:

The solution for getting a keychain prompt when using ssh and keys with your ssh config file using "identitiesonly yes":
Make sure you have a corresponding or in your ~/.ssh directory.
When I had an id_rsa but not a corresponding, Mac OS X kept popping up the dialog and remember passowrd in my keychain did nothing.
cd ~/.ssh
ssh-keygen -y -f id_rsa >
generated the appropriate public key file for me.
If you already had your public file there (rename it to another name) and generate the public key again using the above command, you'll notice that the generated and the old one are not equal. Somehow the older versions of Mac OS X generated a public key that Lion does not like anymore, generating it again fixes that.
For the curious, the key is exactly the same, the part that changes is that there is no "comments" section after the key on the file any longer.