I have tried every possible piece of command I could lay my hands on. I still get this. I spun a digital ocean droplet with ubuntu 16.04 on it. I followed the tutorial until I had to login in again as the new user. I am at my wits end trying to find a solution. This is the output if I give the command ssh-add

Could not open a connection to your authentication agent.
  • You say you followed 'the tutorial' can you post a link or relevant article(s). We'll likely need more info about your config help you out. – Abraxas Jul 27 '16 at 16:47

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

eval `ssh-agent -s` 
  • 1
    For me, I had generated a new SSH key over the top of the old one, and had to run ssh-add to get the system to use it. – kmort Feb 9 '17 at 17:56

This may indicate file permission problems to your ~/.gnupg directory and underlying files!

Also make sure you have valid pinentry installed and operational, otherwise cannot validate PIN to your smartcard and this problem will occur as well!

The example ~/.gnupg/gpg-agent.conf should look like this:

pinentry-program /Applications/MacPorts/pinentry-mac.app/Contents/MacOS/pinentry-mac

After changes are made to the configuration remember to gpgconf --reload.


For gpg2.1

SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" export SSH_AUTH_SOCK


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.