Solved Yubikey 5 is not working with gpg

Hi,

How can I make the gpg work with yubikey 5? The gpg will stuck everytime I execute card related commands in gpg:
gpg --card-status
gpg --edit-card

I follow these threads and I am sure that my freebsd recognise the yubikey:
ugen0.3: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (30mA)

To make it work, I installed required packages and also start the pcsc and gnupg-pkcs11-scd service, but seems like I can not make the yubikey work with gpg in FreeBSD-13.2.
ccid libfido2 py39-fido2 opensc u2f-host u2f-devd pcsc-lite pcsc-tools gnupg-pkcs11-scd


I even tried the UQ_KBD_IGNORE on usbconfig and I load the hidraw kernel module too. However, it still stuck on gpg.

Thanks
 
I don't know for Yubikey, but for Nitrokey it is advised to disable ccid support in gnupg and to use pcsc.
In general you should not have both pcsc and gnupg trying to access the smartcard.
So my advice is to use the pcscd daemon and disable ccid support in gnupg.
You can do this by editing the file $HOME/.gnupg/scdaemon.conf, and adding the line
Code:
disable-ccid
 
I don't know for Yubikey, but for Nitrokey it is advised to disable ccid support in gnupg and to use pcsc.
In general you should not have both pcsc and gnupg trying to access the smartcard.
So my advice is to use the pcscd daemon and disable ccid support in gnupg.
You can do this by editing the file $HOME/.gnupg/scdaemon.conf, and adding the line
Code:
disable-ccid
Thanks. It did the trick
 
Back
Top