20

I succesfully followed these instructions from GitHub on how to generate SSH keys and my connection with GitHub is succesfull.

But when I later want to check my SSH key following these instructions I don't get the SSH fingerprint I see in my GitHub SSH Keys setting page when I use ssh-add -l.

Instead of the SSH key fingerprint I get the message The agent has no identities. Why? And what does it mean?

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
user2312234
  • 265
  • 1
  • 2
  • 13
  • 1
    Aside: This isn't really a programming question -- SSH identities are used for many purposes unrelated to software development, and the question itself has nothing to do with writing code; I'd probably have asked it on http://www.superuser.com/ or http://unix.stackexchange.com/ instead. – Charles Duffy Apr 13 '15 at 19:08

1 Answers1

16

This means you haven't successfully added your key to your agent. Use ssh-add to do so, as given in step 3, part 2 of your first link.

Note that this needs to be done for each ssh-agent instance; thus, if you log out and back in, you need to ssh-add your key again. Similarly, if you start ssh-agent twice, in two different terminal windows, they won't have shared private keys between them, so you would need to ssh-add once in each window (or, better, configure your system in such a way as to have an agent shared between all running applications in your desktop session).

Modern desktop environments generally will provide a SSH keyring for you, so you shouldn't need to start ssh-agent yourself if your agent is so configured, and the agent instance so provided should be shared across your entire session. gnome-keyring behaves this way, as does Apple's keychain and KDE's Wallet (with ksshaskpass enabled).

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441