0

I've been trying to get a yubikey to work as an authentication method for remote connections via ssh using this guide. I got the gpg2 set up nicely, and I can see that i've loaded the key onto the card by

gpg2 --card-status

I've exported it using

gpg2 --export-ssh-key > [keyname].txt

and can see the resulting key nicely. I've got my gpg-agent.conf set up as follows :

#config pinentry-program
pinentry-program /usr/bin/pinentry

#ssh support
enable-ssh-support

#write env inf to .gpg-agent-info
write-env-file
use-standard-socket

#default cache timeout
default-cache-ttl 600
max-cache-ttl 7200

and have modified my .bashrc as given in the guide. Any ideas where I might look for a solution?

3
  • Isn't it more important to test the connection - does it connect? The troubleshooting section suggest to kill the ssh-agent and start the gpg-agent and create a .plist file. Commented Feb 9, 2017 at 11:20
  • @MichaelD. not sure I'm following you - I'm pretty new to linux platforms and I'm going through a lot of new information. What do you mean by test the connection? Connection between what exactly? If it's ssh to the other machine, that works fine. I tried killing the ssh-agent but I'm pretty unsure on how to proceed. Commented Feb 9, 2017 at 12:36
  • Okay - I got it working. The problem was probably the SSH_AUTH_SOCK not pointing to my gpg-agent.ssh , which I resolved by forcing the address in .bashrc. Commented Feb 9, 2017 at 13:28

1 Answer 1

1

Okay, so I got it working after tinkering for a while and reading the gpg-agent manpage here. I needed to add

unset SSH_AGENT_PID
     if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
       export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
     fi

to my .bashrc for the SSH_AUTH_SOCK to point to the correct place instead of the ssh-agent.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.