Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I forgot the passphrase for my ssh private key, but it's still stored in gnome-keyring, so it seems to me that I should be able to recover it. Seahorse lets me recover web site passwords from my keyring, but I don't see a way to recover my ssh passphrase. Can someone tell me how to do this?

share|improve this question
up vote 5 down vote accepted

After some searching and a bit of arguing, two small python programs turned up that do exactly what I needed. Both were able to dump all the passwords that are stored by gnome-keyring, including my ssh key's passphrase. (This is secure, of course, because it only works once I have unlocked my keyring.) See these blog posts for the code:

Thank you, Michael Schurter and Liviu. I can now simply update my passphrase instead of going through the trouble of replacing my old ssh key on every system where it is installed.

share|improve this answer
I think this must have changed with later versions. With Gnome 3.10, the first script only enumerates my Login keys (which "Passwords and Keys" list separately from SSH). I'm still looking for a way to recover an SSH password now. – IBBoard Dec 5 '13 at 20:17

If gnome-keyring works just like ssh-agent, you don't. The passphrase cannot be recovered once it is forgotten. It is used to encrypt the private key and if you forget it... well that's it.

If it is indeed stored internally, then that's another issue.

share|improve this answer
I get the impression that you didn't understood my post. A keyring manager would not work at all if it couldn't recall the passwords stored in it. – ʇsәɹoɈ Oct 3 '12 at 8:12
passPHRASE is not the same as passWORD when you are working with ssh. PassPHRASES are used to encrypt a private encryption key. PassWORDS are used in lieu of key-based authentication. Which are you looking for? PassWORDS or passPHRASES? – UtahJarhead Oct 3 '12 at 12:14
If they're stored at all, something like this will extract it.… The jury is out if ssh passPHRASES are even stored at all, vs cached in memory. I can't find anything specific. However, if gnome-keyring works like ssh-agent does, then the passphrase is cached in memory and not stored to disk meaning recovery would not be possible. – UtahJarhead Oct 3 '12 at 12:42
Are you telling us that you have stored your passphrase in your gnome-keyring, similarly to… ? – Yedric Oct 3 '12 at 14:36
Yedric, yes, my ssh key passphrase is stored my gnome-keyring. (I thought I made that clear in my first sentence.) Upon login, gnome-keyring uses my login password to unlock (decrypt) its own storage, which includes what it needs to automatically load my ssh key without prompting me for a passphrase. In order to do this, it must be able to retrieve either my ssh passphrase or an unencrypted copy of my ssh key from storage once it has my login password. This works, and I know my login password, so there must be a way for me to retrieve that same data. That is my goal. – ʇsәɹoɈ Oct 3 '12 at 17:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .