2

I am trying to setup a YubiKey 5 NFC with GPG on Windows 10 to ultimately use it to sign git-commits.

This is a new topic for me and I ran into some issues that got me stuck now.

I ran into this error:

gpg --card-status
gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

What I did so far to get a hold of the problem based on my online-research as this is a new topic for me:

  • checked usb-interface-activation through the YubiKey Manager-Application (the card is being recognized and all interfaces are activated)
  • created a scdaemon.conf in gpg's home-directory and tried to set the reader-port to either the name of the smartcard as seen in windows' device-manager smart-card-section and as seen in the list of connected USB-devices (to no effect)
  • restarted the computer between tries until I found out the daemon can be reloaded via CLI
  • enabled logging for scdaemon as I hoped that the reader-port string did just have a typo and I wanted to know if gpg at least detects the device in some way which it actually seems to do but fails connecting.

The log looks like this:

2021-05-05 11:17:02 scdaemon[942] listening on socket '/c/Users/nemo/.gnupg/S.scdaemon'
2021-05-05 11:17:02 scdaemon[942] handler for fd -1 started
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> OK GNU Privacy Guard's Smartcard server ready
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 <- GETINFO socket_name
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> D /c/Users/nemo/.gnupg/S.scdaemon
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> OK
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 <- OPTION event-signal=31
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> OK
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 <- GETINFO version
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> D 2.2.20-unknown
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> OK
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 <- SERIALNO
2021-05-05 11:17:02 scdaemon[942] detected reader 'Alcor Micro USB Smart Card Reader 0'
2021-05-05 11:17:02 scdaemon[942] detected reader 'Yubico YubiKey OTP+FIDO+CCID 0'
2021-05-05 11:17:02 scdaemon[942] reader slot 0: not connected
2021-05-05 11:17:02 scdaemon[942] pcsc_connect failed: removed card (0x80100069)
2021-05-05 11:17:02 scdaemon[942] reader slot 0: not connected
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> ERR 100696144 No such device <SCD>
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 <- RESTART
2021-05-05 11:17:02 scdaemon[942] DBG: chan_7 -> OK
2021-05-05 11:18:07 scdaemon[942] DBG: chan_7 <- GETINFO version
2021-05-05 11:18:07 scdaemon[942] DBG: chan_7 -> D 2.2.20-unknown
2021-05-05 11:18:07 scdaemon[942] DBG: chan_7 -> OK
2021-05-05 11:18:07 scdaemon[942] DBG: chan_7 <- SERIALNO
2021-05-05 11:18:07 scdaemon[942] detected reader 'Alcor Micro USB Smart Card Reader 0'
2021-05-05 11:18:07 scdaemon[942] detected reader 'Yubico YubiKey OTP+FIDO+CCID 0'
2021-05-05 11:18:07 scdaemon[942] detected reader ''
2021-05-05 11:18:07 scdaemon[942] reader slot 0: not connected
2021-05-05 11:18:07 scdaemon[942] pcsc_connect failed: removed card (0x80100069)
2021-05-05 11:18:07 scdaemon[942] reader slot 0: not connected
2021-05-05 11:18:07 scdaemon[942] DBG: chan_7 -> ERR 100696144 No such device <SCD>
2021-05-05 11:18:07 scdaemon[942] DBG: chan_7 <- RESTART
2021-05-05 11:18:07 scdaemon[942] DBG: chan_7 -> OK
2021-05-05 11:21:11 scdaemon[942] DBG: chan_7 <- killscd
2021-05-05 11:21:11 scdaemon[942] DBG: chan_7 -> OK closing connection

So I tried setting the reader-port in the config to "Yubico YubiKey OTP+FIDO+CCID 0" after reading that but that also didn't have any effect.

What am I missing?

3
  • I'm fighting the same thing right now and made it pretty much exactly as far as you. I'm assuming some other process is stealing the YubiKey out from under scdaemon, but I can't figure out what. Did you ever get any further with this?
    – JustinB
    Aug 16, 2021 at 17:39
  • Sorry for coming back to you after such a long time. Actually I was not able to solve this problem even after an elongated conversation with the YubiKey-support team which i must say did really put in some effort to help me, so kudos to them. Unfortunately due to outer circumstances I lacked time to pursue this any further. What I think i can say with at least some degree of confidence is that one of the company-preinstalled readers interferred with the process and I wasn't able to make it recognize the correct one.
    – Wolfone
    Sep 29, 2021 at 12:50
  • Maybe I should add that my confidence derives from testing this against a non-company-pre-installed Ubuntu-system (20.04) on the same hardware and possibly even on my own hardware that didn't have any readers preinstalled (running Win10Prof) though I wouldn't want to swear on this as it has been several months since then. Result of the whole ordeal is that I got a really weird setup of a dual-boot-system running on my work-thinkpad to accomodate different project-needs. As you might not have such a weird presetup to deal with I would advise contacting yubi-support as they really tried to help.
    – Wolfone
    Sep 29, 2021 at 12:54

1 Answer 1

1

I was hitting a dead end like the others above.

Then I got it to work:

Opened a Powershell and:

PS C:\WINDOWS\system32> Get-PnpDevice -Class SoftwareDevice | Where-Object {$_.FriendlyName -like "*YubiKey*"} | Select-Object -ExpandProperty FriendlyName
Yubico YubiKey OTP+FIDO+CCID 0

took that name "Yubico YubiKey OTP+FIDO+CCID 0" (it can vary per Yubikey model), and put that into

C:\Users\<username>\AppData\Roaming\gnupg\scdaemon.conf

reader-port Yubico YubiKey OTP+FIDO+CCID 0

then I bounced the agent:

> gpg-connect-agent killagent /bye
> gpg-connect-agent /bye

After that, my command prompt could read the Yubikey when I did gpg --card-status. Also as an added bonus I saw I could manage the card in Kleopatra.

I suspect OP had it right but didn't restart the agent to pick up the changes in the scdaemon.conf.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .