title: How do I get my Yubikey to work with SSH in Windows 10?
body: <p>after buying a Yubikey 5 NFC for technical interest (firmware 5.2.7) and setting up FIDO2 authentication where possible, I ran into the problem that I could no longer connect to my GitLab server via SmartGit because the second factor is not requested and therefore I can't connect to the server.</p>
  <p>I then decided to deal with it on Windows 10 via Git Bash and SSH. Unfortunately, the documentation here assumes a lot of prior knowledge and I am an absolute beginner on the subject. In the meantime I managed to connect to the server with Git Bash and SSH using a locally generated SSH certificate.</p>
  <p>Now I would like to use the Yubikey instead of the certificate stored locally on the computer. Unfortunately, all instructions (e.g. this one <a href="https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key-for-a-hardware-security-key" rel="noreferrer">https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key-for-a-hardware-security-key</a>) lead to the same error message for me:</p>
  <pre><code>$ ssh-keygen -t ed25519-sk -C &quot;name@mail.com&quot;
  Generating public/private ed25519-sk key pair.
  You may need to touch your authenticator to authorize key generation.
  Key enrollment failed: invalid format
  </code></pre>
  <p>Before that, I am prompted to enter the PIN. The interesting thing: The message looks exactly the same, whether I have inserted the Yubikey or not does not matter. The attempt with ecdsa-sk leads to the same result.</p>
  <p>(btw. I have already successfully stored an OpenPGP certificate on the Yubikey.)</p>
  <p>Now I also read something about libfido2, however I can't find any instructions on how to use it on Windows 10.</p>
  <p>So my question: how do I manage to use my Yubikey instead of my local key?
  Or: How do I install libfido2 if this is the problem?</p>