Mac – I forgot the private key’s passphrase, but I use it every day

keychainmacssh

…from my Mac. I think Keychain Access remembers my passphrase and applies it every time I log in to a server, but in this instance I can't log in to the remote server directly from my laptop; I have to first log in to a different server and then attempt to ssh to my target. Which doesn't work because even though I have copied my id_rsa to my user dir on the first server and set permissions correctly, it is not automatically decrypted as it is on my laptop and I am prompted for a passphrase. Which I don't know. So my question is: is there a way to retrieve that passphrase from Keychain Access? Or am I hosed?

Best Answer

[I]s there a way to retrieve that passphrase from Keychain Access? Or am I hosed?

Keychain Access has to store the passphrase to be able to use it. So even without knowing the application, the answer has to be yes (to the former, not the latter), although it could be difficult to retrieve it.

In you specific case, it's easy. Just open Keychain Access, search for the entry regarding your key file in Keychains and toggle the box Show password.

Related Question