I have a Yubikey 4. On a Windows 7 64 bit machine I installed Gpg4Win which includes GnugPG. I was able to successfully import public keys. I plugged in the Yubikey 4 and Windows correctly identified and installed the proper drivers.
However, issuing the ' gpg --card-status ' command results in:

gpg: selecting openpgp failed: No such device

gpg: OpenPGP card not available: No such device

This is strange behavior as I can see the Yubikey information using the Yubikey Personalization Tools (name, serial number, etc).

I have confirmed in Windows Services that "Smart Card" service is running. I have also ran 'scdaemon.exe --server -v' and it says "smartcard server ready" and I also tried "gpg-agent --server -v" and it says "OK Pleased to meet you". When I run the gpg --card-status command it doesn't reflect any verbose in those command prompts.

Any ideas on what would be causing this? Yubikey personalization tools and neo manager can detect and read the Yubikey but GPG cannot.

EDIT: I did the same steps on a different Windows 7 64 bit machine and it works (download gpg4win, import public keys, insert Yubikey and type in gpg --card-status and it loads stubs. So this seems to be a local issue on the local machine, so what services or what tools exist to diagnose the issue on the original machine where it doesn't read the card (but Windows does). I also tried opensc and it detects the Yubikey as well, but gpg does not.

  • When adding YubiKey, I had two smartcard readers on my system. ( the original and the Yubikey) Disabling the other one solved this error. – Luc Vandenbroucke Jun 11 '18 at 10:06
  • I am not entirely sure whether this will help... But I bumped into this question when trying to solve a similar issue, and thought this might help: superuser.com/questions/1343569/… – vagaerg Jul 26 '18 at 16:52

I know this is a bit old thread, but since Google brought me here the 1st time I was searching the answer for this error message, I wanted to share a solution which worked for me.

My device has another smart-card reader. In the device manager I had to disable the other reader. Once it was disabled, gpg started to work properly. (You don't need to uninstall the device, and you can re-enable it when you want to use it)

Hope this helps someone.

Disabled device

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.