Two YubiKeys, One Prompt Too Many
I carry two YubiKeys. One lives on my keyring, one lives in a drawer, and both are enrolled everywhere that matters. A hardware token with no backup is a single point of failure you have chosen on purpose. For months I had a small irritation I never bothered to chase. Some days git push asked for my PIN, I typed it, and it worked. Other days it asked for my PIN, failed, and then asked again, and…
I carry two YubiKeys - one attached to my keyring, and the other stored in a drawer. Both are linked to my GitHub account, which accepts the first recognized token when authentication requests arise. For months, I encountered a minor annoyance: occasionally, the `git push` command would repeatedly request my PIN, failing until the correct YubiKey was inserted.
The issue stemmed from how these keys were generated - both are resident keys requiring user verification. This means that before the server can recognize the credential, the client must first obtain a PIN/UV auth token from the authenticator. The step that triggers this dialog can cause the confusion. The solution was to add custom configurations in the `~/.ssh/config` file to specify which YubiKey to use for GitHub or GitLab. This allows the system to bypass the dialog and authenticate without issue.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.