I am trying to set up my Yubikey on Windows such that I am able to SSH with it to my server.

I successfully generated keys on it and extracted the public key in SSH format (I did this on a linux VM). Now, I am trying to use the Yubikey to SSH from Windows to a Linux server.

Putty works out-of-the-box, as described here. However, I am having trouble configuring Cygwin. I was sure to not install the Gnupg packages. I did install the ssh-pageant packages, which should make it work with the Putty agent. Then, I added the following line to my bashrc:

eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME")

Since I am using a different user to log in with, I also tried to run the following command.

eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-yubikeytest")

However, I get the following error when I try to connect

$ ssh yubikeytest@
Pseudo-terminal will not be allocated because stdin is not a terminal.
yubikeytest@ Permission denied (publickey).

I am able to see the card details using gpg --card-status. However, gpg --card-edit does not return any output and I have to manually end the process.

I am also able to see the card in Kleopatra.

Furthermore, I am unable to see the key when running ssh-add.

$ ssh-add -L
Error connecting to agent: No such file or directory

I also tried adding the following code to my bashrc file, but it has the same results.

export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)


MINGW64 also works (using the previously mentioned eval command)

Your Answer

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

Browse other questions tagged or ask your own question.