I forgot my private key's passphrase, but I use it every day

4

1

...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?

railsn00b

Posted 2012-12-24T03:43:47.820

Reputation:

Answers

9

[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.

Dennis

Posted 2012-12-24T03:43:47.820

Reputation: 42 934

0

Sorry, you are hosed....

the point of having a passphrase is to protect the key for unauthorized use. Having it be easily or even designing it to be crackable would ruin the trust anybody had and nobody would be using a passphrase.

You'll have to generate a new public/private key and optional passphrase....

mdpc

Posted 2012-12-24T03:43:47.820

Reputation: 4 176

-1. Given the answer by Dennis that Shows how to do it. In this particular case the passphrase is easily accessible. – TomTom – 2012-12-24T06:36:24.520

1Although I might agree that I might have misunderstood something in the question and based on that I provided the wrong answer....I don't think I deserve the language or tone that you provided here in your comment. Apparently from the comments, others interpreted the question the same way that I did. – mdpc – 2012-12-24T06:45:18.900

1NOTE: Offensive comment has been edited out, since my my last comment. – mdpc – 2012-12-24T06:57:22.220