The 5 NFC stays plugged into the desktop. The 5C hangs on a keyring. OpenPGP and a resident SSH key are on the 5 NFC. SSH offers the 5 NFC first. GitHub and the house accept that key and the 5C. Serials, firmware, and USB ids live in the private homelab inventory, not in this note. PINs live in [[Bitwarden]], not here.

This note started as a 2015 post about U2F on a YubiKey Neo and a 4C. The procedures from that post are gone. They described manual udev rules, ykpersonalize -m6, PIV as the SSH key, and using the OpenPGP applet as the SSH key. None of that is how this machine works.

Motivation

I had been typing a code from an app on my phone as a second factor. The code is a shared secret: the site and the phone both have it, and a lookalike page will take it. A security key signs a challenge bound to the real site, and a touch is the confirmation. That is still why the key is on the account, on SSH, and on the yadm archive.

Applications

A YubiKey 5 is several independent applications behind one touch button. SSH and a website security key are the same FIDO application. They are not OTP.

Application What a touch does Used here
FIDO U2F Security-key second factor. The browser asks the key to sign a challenge for that site. Nothing is typed. A normal registration uses no credential slot. Yes. Google, GitHub, and other sites that offer a security key. Leave enabled.
FIDO2 Same module as U2F, newer protocol. SSH ed25519-sk, WebAuthn, and passkeys. Discoverable credentials (the SSH key, each passkey) use one of 100 slots on firmware 5.7 and later. The 5C (firmware 5.4.3) has 25. Yes. SSH, and passkeys if I store any on the key. Leave enabled. Shares the one FIDO2 PIN with U2F.
OpenPGP GnuPG smart card. Decrypt, sign, and authenticate are three key slots. Yes. Decrypting the [[dotfiles]] yadm archive. Leave enabled over USB.
Yubico OTP The key pretends to be a keyboard and types a long one-time string into whatever window is focused. Slot 1 on a new key is the factory Yubico OTP. Only for the [[Bitwarden]] CLI, and only if that account method is turned on. Not used for SSH or for Google. Can be disabled when the CLI uses an authenticator code or email instead.
OATH Stores TOTP or HOTP secrets. Yubico Authenticator shows the 6-digit codes. This is not the OTP application, and it is not FIDO. No. Those codes live in [[Bitwarden]]. Can be disabled.
PIV X.509 smart-card certificates. The old way to do SSH, through PKCS#11. No. SSH is FIDO2. Can be disabled. The factory PIN and PUK can stay untouched once the application is off.
YubiHSM Auth Unlocks a YubiHSM. No. Can be disabled.

FIDO U2F and FIDO2 are two switches on one module. Disabling FIDO2 would remove SSH and passkeys. Disabling U2F would remove older security-key registrations. Both stay on.

OTP is the one that surprises people, because the touch is the same. During an SSH or browser prompt the FIDO module answers the challenge. With the OTP application still enabled, a touch that no application is waiting on types the OTP string into the focused window.

The 5 NFC shipped with every application enabled. It is now:

Application USB NFC
Yubico OTP Enabled Disabled
FIDO U2F Enabled Enabled
FIDO2 Enabled Enabled
OpenPGP Enabled Disabled
OATH Disabled Disabled
PIV Disabled Disabled
YubiHSM Auth Disabled Disabled

USB interfaces are still OTP, FIDO, and CCID, because OTP and OpenPGP need them. The FIDO2 PIN and both OpenPGP PINs are set. The values are in [[Bitwarden]]. OTP slot 1 is the factory Yubico OTP, registered on the [[Bitwarden]] account. Slot 2 is empty. The 5C has not been changed to match this lockdown.

Linux

Current Arch and Omarchy talk to a YubiKey without a hand-written udev rule.

/usr/lib/udev/rules.d/69-yubikey.rules is owned by the Arch package yubikey-personalization 1.20.0-5. pacman -Qkk reports that package as unmodified. The rule sets ENV{ID_SECURITY_TOKEN}="1" for Yubico vendor 1050. /usr/lib/udev/rules.d/60-fido-id.rules is owned by systemd. It tags hidraw security tokens and CCID readers. There is no YubiKey rule under /etc/udev/rules.d. logind then grants the console user access. ykman and fido2-token already see both keys as my user.

pcscd.socket is enabled. ykman uses it. GnuPG's built-in CCID driver does not see the card while pcscd holds it, so ~/.gnupg/scdaemon.conf is:

disable-ccid
pcsc-shared

FIDO uses USB HID and does not need pcscd.

Packages that are installed and enough:

Package Role
yubikey-manager (ykman 5.9.2) Inspect the key, set PINs, enable and disable applications. This is the tool I use, and the one Grok uses.
yubikey-personalization Ships the udev rule above. The ykpersonalize command from this package is the old mode switch. I do not use it.
libfido2 OpenSSH talks to the FIDO applet through this.
OpenSSH 10.6 ed25519-sk, resident keys, ssh-add -K, ssh-keygen -K.
gnupg 2.4.9 and pinentry OpenPGP card.
ccid and pcsclite Smart-card driver and daemon.
yubico-piv-tool PIV only. Installed, unused while PIV is not part of the setup.

opensc and pcsc-tools are not installed. I do not need them for FIDO or OpenPGP.

When both keys are plugged in, ykman requires --device SERIAL. GnuPG does not take a serial. gpg --card-status with both keys inserted reports that no OpenPGP card is available. Unplug the key that is not being edited before any gpg --edit-card step.

PINs

Three PINs matter. They are different secrets. A FIDO lockout does not lock OpenPGP, and the reverse is also true. Losing one physical key is why the other key exists.

PIN Factory value on the 5 NFC Wrong guesses Unlocks
FIDO2 Not set 8, then the FIDO application resets and every FIDO credential on that key is destroyed. One success restores the 8. SSH, security keys, passkeys. One PIN for all of them.
OpenPGP user 123456 3 Decrypt and sign.
OpenPGP admin 12345678 3 Change the user PIN, the touch policy, and other card admin. Also unblocks the user PIN.

The OpenPGP reset code is not set. Leave it unset. The admin PIN already unblocks the user PIN.

On the 5 NFC the three PINs above are set, with 8 FIDO tries and 3 OpenPGP tries remaining. ykman fido info reports a minimum FIDO PIN length of 4 and a maximum of 63. Always Require UV is off. I am leaving that off. Yubico's own SSH guide prefers -O verify-required, which asks for the FIDO PIN on every signature. The 5C key does not work that way, and non-biometric keys have had OpenSSH bugs with that option. The FIDO PIN is required when creating a resident credential and when loading one with ssh-add -K. Day-to-day SSH then asks for a touch. Website logins ask for the PIN when the site asks for user verification.

Use 6 to 8 digits, numeric. Some clients only promise to accept alphanumeric PIN characters, and numeric is the reliable subset. The OpenPGP user PIN is 6 to 127 characters. The admin PIN is 8 to 127. Use three different values. Store them in Bitwarden. The commands, once I am ready to type the new values in a terminal, are:

$ ykman --device SERIAL fido access change-pin
$ ykman --device SERIAL openpgp access change-pin
$ ykman --device SERIAL openpgp access change-admin-pin

ykman fido access change-pin sets the PIN when none is set. PIV has its own factory PIN 123456, PUK 12345678, and a default management key. I am not keeping PIV enabled, so those stay unused.

Firmware is not field-upgradable. The 5 NFC is already on 5.8, the current non-FIPS release as of 2026. The 5C is on 5.4.3. That older firmware is affected by the P-256 WebAuthn side channel (EUCLEAK). The Ed25519 SSH credential is not that algorithm. New website registrations prefer the 5 NFC. The 5C stays enrolled as the second key. Do not factory-reset the 5C.

SSH

SSH uses FIDO2. The credential type is ed25519-sk. The private key is generated on the YubiKey. An existing SSH key cannot be imported into FIDO. PIV and the OpenPGP authentication slot are not on this path. gpg-agent SSH support stays off so it does not compete with the FIDO key.

Host * in ~/.ssh/config is:

IdentitiesOnly yes
IdentityFile ~/.ssh/id_ed25519_sk_5nfc.pub
IdentityFile ~/.ssh/id_ed25519_sk.pub
IdentityAgent /run/user/1000/ssh-agent.socket

There is no ~/.ssh/id_ed25519_sk private file. The file ssh is pointed at is the public key. ssh-add -K loads the resident credential from the plugged-in YubiKey into the agent. The public key tells ssh which agent key to offer. IdentitiesOnly yes means a key that is only in the agent, and not named by IdentityFile, is not offered.

The public key comment on that file is ssh:dub@podval.org-yk5c-fido2. That comment is the FIDO application string, which is what ssh-keygen -K writes back. The same public key is in this repo as keys/yubikey.pub, without the comment. ykman fido credentials list shows the -O user value, which was dub@podval.org.

A second YubiKey is a second credential. It needs its own public-key file so two things stay true: the 5C file is not overwritten, and IdentityFile can name the new key. It does not need a long-term private stub. ssh-keygen will write one beside the public key. After ssh-add -K has loaded it, that stub can be removed, which matches the 5C. The public key is ~/.ssh/id_ed25519_sk_5nfc.pub, with application ssh:dub@podval.org-yk5nfc-fido2, so the two resident keys stay distinct when both are loaded. Touch stays required. No passphrase on the stub: the stub is not the secret. That key was generated on 2026-11-30. The stub was removed after ssh-add -K loaded it. The same public key is in this repo as keys/yubikey-5nfc.pub, without the comment.

$ ssh-keygen -t ed25519-sk -O resident -O application=ssh:dub@podval.org-yk5nfc-fido2 -O user=dub@podval.org -f ~/.ssh/id_ed25519_sk_5nfc
$ ssh-add -K
$ ssh-add -L

GitHub account dubinsky has this key, titled ssh:dub@podval.org-yk5nfc-fido2. root on Home Assistant, Proxmox, Frigate, and UniFi has it in authorized_keys. The 5C key is still accepted there. The 5 NFC is offered first because it is the key that stays in the desktop.

no-touch-required is rejected by OpenSSH's default and by GitHub. I am not using it.

rclone's built-in SFTP cannot sign sk-ssh-ed25519 through the agent. The gatekeeper remote uses OpenSSH: ssh = ssh -o BatchMode=yes dub@gatekeeper. That also lets ControlMaster cover the extra connections --checksum opens. rclone's Go SSH prefers ECDSA over Ed25519. The Proxmox host needs all of its host-key types in known_hosts. The address is in the private ProxMox note.

OpenPGP

The 5C carries OpenPGP key 049DC4EF6FB97468, created on that card on 2026-08-17. The on-disk copies are stubs (sec>). The card serial in GnuPG is the 5C. Touch policy on that card: sign off, decrypt on, auth off. The public key is keys/yubikey-openpgp.asc in this repo and ~/.config/yadm/yubikey-openpgp.asc on the machine. Algorithms on that card: Ed25519 for sign and authenticate, Cv25519 for decrypt.

The 5 NFC carries OpenPGP key 5643F2497D805A8B, created on that card on 2026-11-30. The on-disk copies are stubs (sec>). There is no off-card private key. Algorithms are the same: Ed25519 for sign and authenticate, Cv25519 for decrypt. Touch policy is the same: sign off, decrypt on, auth off. KDF is off. GnuPG stored a revocation certificate on this machine when it generated the key. That file is not a copy of the private key. The public key is keys/yubikey-5nfc-openpgp.asc in this repo and ~/.config/yadm/yubikey-5nfc-openpgp.asc on the machine.

That private key on the 5C cannot be copied onto the 5 NFC. The backup is the 5 NFC key, plus a yadm archive encrypted to both public keys. Either card can then decrypt. An off-card copy of the new private key is a third copy of the secret. I am not planning to keep one. The other YubiKey is the backup. If both keys are lost, the archive is unreadable. That is what losing the 5C alone used to mean.

yadm 3.5 takes several recipients, separated by spaces, in yadm.gpg-recipient. The man page says so. The recipients are 049DC4EF6FB97468 and 5643F2497D805A8B. Decrypt with one key plugged in. Two cards at once make GnuPG lose the card.

Generation is gpg --edit-card after the 5C is unplugged, with key attributes set to Ed25519 and Cv25519 before generate. ykman 5.9 on this machine can change OpenPGP PINs and the touch policy. It cannot generate the keys. Say no to GnuPG's offer of an off-card encryption backup. Set decrypt touch to on, same as the 5C. Leave gpg-agent SSH support off. The sign and auth slots that generate also creates can sit unused. Do not publish this key to a keyserver. It is the yadm recipient, not an email identity.

KDF stays off. GnuPG 2.4.9's kdf-setup writes hashes of the factory PINs 123456 and 12345678, not the PINs already set on the card. Running it after the PIN change would make those new PINs stop working.

yadm

Traveling secrets go through yadm encrypt. The pattern file, the archive path, and the current recipient are in [[dotfiles]]. Encrypt uses the public key and does not need a touch. Decrypt needs the card, the OpenPGP user PIN, and a touch. The agent caches that PIN for its default 600 seconds. A cached PIN plus decrypt-touch still blinks the key, and a touch timeout does not burn a PIN retry.

Commit signatures

Git is not using the YubiKey for signatures. user.signingkey is C0525CD6511BCEB1, the on-disk primary from 2003 (Leonid Dubinsky <dub@podval.org>). That primary has an Ed25519 signing subkey 795D3E0044ED9402 from 2025-12-26. gpg.format, commit.gpgsign, and tag.gpgsign are unset, so signing is opt-in per repository. An SSH key cannot be turned into an OpenPGP key. For the rare repository that wants a signed commit, the cleaner setup is Git's SSH signing (gpg.format ssh) with the FIDO key that already signs SSH. GitHub can verify that once the public key is registered as a signing key. Each YubiKey has its own SSH key, so each public key is registered on its own. I have not switched any repository over.

Maven Central

Publishing still requires an OpenPGP signature. The Central Portal also accepts a Sigstore bundle. A missing Sigstore bundle does not fail the publish. The Gradle publisher signs from armored secrets in ~/.gradle/gradle.properties, one for dub@podval.org and one for dub@opentorah.org. A key that exists only on a YubiKey cannot be exported into that file, and a release would need a touch per artifact. Those desktop keys stay where they are. Old artifacts keep verifying against the keys that signed them. The notes for that setup are in the Maven Central post. keys/dub-podval-org.pgp and keys/dub-opentorah-org.pgp are the public halves in this repo.

Email

I do not sign or encrypt mail. A sign slot on the card does not by itself set that up. Mail clients, a published key, and keyserver upload are a separate project. I am not doing that.

Websites, passkeys, and Bitwarden

A site security key is FIDO U2F or FIDO2. Both physical keys are registered on Google, GitHub, the [[Bitwarden]] account, and Cloudflare, the registrar. Backup codes for those accounts are in [[Bitwarden]]. A second-factor security key uses no slot. A passkey is a discoverable FIDO2 credential. It uses one slot, asks for the FIDO PIN, and does not sync. One hundred slots on the 5 NFC is enough. Which passkeys stay in the vault, and how bw login works, is in [[Bitwarden]].

A static password in an OTP slot is a bad substitute for [[Bitwarden]]. The key types it into whatever is focused. OATH copies the same problem onto the key and puts both factors on one device. Disk unlock and sudo can be bound to a YubiKey. That is easy to lock yourself out of, and it is not part of this setup.

5 NFC setup

Done on the 5 NFC: the three PINs, the application lockdown in the table above, factory slot 1 OTP registered on the [[Bitwarden]] account, and OpenPGP key 5643F2497D805A8B. That key is Ed25519, Cv25519, Ed25519, with no off-card backup, decrypt touch on, and KDF off. bw login offers YubiKey, so OTP stays on USB. Both cards decrypted the yadm archive on 2026-11-30, one key plugged in at a time. The 5 NFC SSH key is registered on GitHub and on the four house hosts, and it is offered first. The 5C stays as it is.