Recover SSH private key passphrase from keychain

keychainssh

After performing a macOS upgrade ssh asked for my ssh passphrase. I have completely forgotten the passphrase since keychain has been managing it.

This answer shows how to configure keychain to reconnect and remove my need to enter the passphrase when connecting to a host. After following those steps I can ssh successfully without knowing the private key passphrase, which suggests that the passphrase is stored in keychain.

However, I can't find the ssh passphrase in keychain. Is there a way to recover the ssh key passphrase from keychain?

This question/answer says that keychain keeps passphrases as regular keychain items, but I can only find one item after searching for ssh and that is an older item for my original id_rsa key which is no longer is use.

Best Answer

Open Keychain Access and enable the option View > Show Invisible Items.

Than you must search for id_rsa or ‘ssh’.