I just created a set of SSH keys and used ssh-copy-id to copy it on to a remote server.

Upon trying to connect via ssh I got the error

sign_and_send_pubkey: signing failed: agent refused operation

Similarly, when trying to connect via MOSH I get asked for a passphrase even though these keys were made without a passphrase at all.

All of the permissions on my .ssh folder (and my home directory) were set to 700.

Looking at this answer led me to try

I think your ssh-agent isn't working ! Perform the following commands...

    eval ssh-agent -s 
    ssh-add

which immediately made the login work. The problem with this is that I do not want to always have to use ssh-agent, MOSH itself does not support SSH-Agent and so I am wondering if there is a way I can make my keys work without using ssh-agent. Can somebody explain to me if this is possible.

Note: The remote computer in this case is a Raspberry PI running Pidora.

  • Exactly what command are you using when it fails? – drewbenn Aug 23 '16 at 20:58
  • ssh username@ipaddress Also, the other way, with mosh, was just by opening the chrome app and typing in the username and password – Startec Aug 23 '16 at 20:58
  • What is the name of your key file? If it is not one of the defaults (see man ssh), you will need to provide it (e.g. with -i) or provide a key agent for it to use. Similarly, does Mosh know what key to use? – drewbenn Aug 23 '16 at 21:02
  • For mosh there is only one way to upload a key, and only one at a time so yes it knows which key to use. The name of my key file, used in both, is just id_rsa – Startec Aug 23 '16 at 21:03
  • Standard debugging suggestions, then: try ssh with -v then if that's not enough with multiples (-vvv), and look at the sshd logs (maybe /var/log/secure?) on the remote system if you have access to them – drewbenn Aug 23 '16 at 21:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.