1. GPG does not detect the YubiKey
If gpg --card-status does not return information about your key as expected (e.g. you receive the error message “no such device”), follow the sections below to troubleshoot.
Using YubiKey Manager, ensure that either CCID (if you have a YubiKey 4 Series or NEO) or OpenPGP (if you have a YubiKey 5 Series) is checked under Interfaces. Security Key Series devices do not support OpenPGP (see Applicable Products above).
Remove and reinsert the YubiKey. Sometimes, the GPG agent does not correctly detect if the YubiKey is plugged in.
Force GPG agent to restart by running gpgconf --kill gpg-agent in Command Prompt (Windows) or Terminal (macOS / Linux).
If GPG is still not detecting the YubiKey, you may need to change some of GPG’s options. Using a text editor, add the line “reader-port Yubico Yubikey” (if you have a YubiKey 4 Series or NEO), or "reader-port Yubico Yubi" (if you have a YubiKey 5 Series), without quotes, to the scdaemon.conf file. If the file does not exist, create it.
On Windows, the path to this file is: %APPDATA%\gnupg\scdaemon.conf
On macOS and Linux, the path to this file is: ~/.gnupg/scdaemon.conf
After making this change, reboot your computer to ensure it takes affect.
If you are running a distribution of Linux that uses systemd, you may need to start and enable the pcsc daemon, which can be done by running the following commands.
#systemctl start pcscd
#systemctl enable pcscd