I have the following file in ~/.ssh that has my public SSH key:

  • authorized_keys

I then run the following and add my passphrase and get no errors or warnings:

$ ssh-add ~/.ssh/authorized_keys

When I try to list the fingerprints I get:

$ ssh-add -l
> The agent has no identities.

When I re-run ssh-add and follow up with echo $? it returns an exit code of 1 meaning a failure occurred. This documentation says that code 1 means the error was caused by:

Invalid identification string of SSH-protocol

What does this mean exactly, and how do I resolve it?

1 Answer 1


ssh-add loads private keys, not public keys. From man ssh-add:

     ssh-add adds private key identities to the authentication agent, ssh-agent(1).  When run without arguments, it adds
     the files ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and ~/.ssh/identity.  After loading a
     private key, ssh-add will try to load corresponding certificate information from the filename obtained by appending
     -cert.pub to the name of the private key file.  Alternative file names can be given on the command line.

Try to run it without arguments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.