What does 'the agent has no identities' mean?

user2312234 picture user2312234 · Apr 13, 2015 · Viewed 30.7k times · Source

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?

Answer

Charles Duffy picture Charles Duffy · Apr 13, 2015

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