Export the id_rsa cert from Keychain Access

keychainssh

I'm migrating to a new Macbook. On my old one, I generated an ssh key pair many years ago, and I have configured that key on several sites, some of which I don't have direct control over. After I set up my keypair, I used ssh-add to import the cert into my keychain so I wouldn't have to type the passphrase every time. This worked fine.

Now that I am migrating to a new Mac, I am trying to import my id_rsa key on my new mac, but it's asking me for a passphrase that I apparently do not remember. I feel like that passphrase must be stored in the keychain of my old mac (which I still have), but I haven't figured out which of the entries in my old keychain is my id_rsa cert (we use S/MIME encrypted e-mail at work and the cert expire frequently, so I have quite a few certs in there).

So — is there a way for me to either view the passphrase of my id_rsa cert in Keychain Access (after I unlock it with my system password), or to export my keypair from Keychain access in such a way that I can import it on my new Mac without having the original passphrase?

Thanks!

Best Answer

There was a similar question on SuperUser here on SE.

If you have still have access to your old Mac and you can successfully login into whatever services require your id_rsa cert with your passphrase saved in Keychain, you should be able to get the passphrase with no problem.

Basically, you should be able to see the passwords by selecting Show Password in Keychain.

Have a look at this answer for details