Search code examples
gitpowershellsshyubico

git clone over SSH in PowerShell with Yubikey on W10


On a new Windows 10 install (Build 18362) I would like to use my Yubikey Neo, which has an Authentication subkey (along with an Encryption and a Signing subkey), to clone a Git repo over SSH:

git clone git@bitbucket.org:boggin/something.git

I have a gpg-agent.conf:

enable-putty-support
enable-ssh-support
default-cache-ttl 600
max-cache-ttl 7200

Note that OpenSSH, which is the default SSH client now, won't work (Support GPG and smartcard users) but you can use PuTTY. I've tried setting the ssh.variant to putty in my .gitconfig but this doesn't seem to work.

What steps do I need to take to make Git use PuTTY SSH and recognize the Yubikey?


Solution

  • The following steps have worked for my case.

    In a Yubikey + Windows guide I found:

    git config --global core.sshcommand 'plink -agent'
    

    The console will hang if you try to clone a repo now but the above linked guide shows how you can get past this:

    putty.exe -ssh git@github.com
    

    Now git clone will work.