In this guide I will show you a possible fix for Windows not detecting your YubiKey.
I was using Windows on my laptop, when I required to set up GPG so that I can SSH to a server, using my YubiKey. I did set up GPG4Win as I usually would, but noticed that whenever I typed the following command in the CMD:
gpg --card-status
I would simply get “No such device” as error.
GPG expects a “smart card”, and as you might know, your YubiKey acts as smart card reader. So, usually GPG just uses your YubiKey and all works fine.
But in my case, my laptop has an actual smart card reader built-in. And it seems GPG was trying to use that.
Since I don’t have any actual smart card for GPG, and want to use my YubiKey, all I had to do was disabling the built-in reader.
To do that, go to your Start Menu, type “Device Manager” and open it as Administrator, and scroll down until you see “Smart card readers”:
Now right-click on your built-in reader, and choose “Disable device”. If you have multiple built-in readers that you don’t need, you can disable them all. After disabling it, you will see a little icon with an arrow pointing down. Don’t worry, you can always re-enable your device again if you need it.
But make sure you keep “Microsoft Usbccid Smartcard Reader (WDUDF)” enabled!
Now, restart the GPG agent with (in CMD or PowerShell):
gpg-connect-agent.exe killagent /bye
gpg-connect-agent.exe /bye
And now try gpg --card-status
again, and you should see your YubiKey.
That’s all there is to it!
PS If you’re on Linux, and your built-in reader conflicts with the YubiKey, you could try to blacklist your built-in reader. An alternative, cross-platform solution if your BIOS/UEFI supports it, is disabling the smart card reader there, assuming you don’t need it. And in case it’s not a built-in reader, just unplug any reader you don’t need. For example, if you have a USB smart card reader, or another YubiKey, unplug it.
Leave A Comment