- YubiKey 5 series (e.g., YubiKey 5C NFC)
- ykman (YubiKey Manager CLI) installed
- KeePassXC installed
- Existing KeePassXC database
openssl rand -hex 20Copy the 40-character hex output. Save it temporarily somewhere secure.
# Check current slot status
ykman otp info
# Delete slot 2 if already configured
ykman otp delete 2
# Program slot 2 with your secret (requires touch)
ykman otp chalresp --touch 2 <your-40-char-hex-secret>
# Verify slot is configured
ykman otp info# Challenge must be hex-encoded ("test" = 74657374)
ykman otp calculate 2 74657374Touch the YubiKey when it blinks. Should return a 40-char hex response.
Repeat for each backup YubiKey:
# Unplug current YubiKey, plug in the next one
ykman otp delete 2
ykman otp chalresp --touch 2 <same-secret-as-step-2>
# Verify
ykman otp calculate 2 74657374All YubiKeys should return the same response to the same challenge.
- Open your database
- Go to Database → Database Security
- Click Add Additional Protection...
- Select Add Challenge-Response
- Select your YubiKey and Slot 2
- Click OK
- Save the database (Ctrl+S)
- Lock database (Ctrl+L)
- Unlock with passphrase
- Touch YubiKey when prompted
- Repeat test with each backup YubiKey
# Encrypt the secret with GPG
echo "<your-secret>" | gpg -e -r your@email.com > yubikey-hmac-secret.gpg
# Or store it offline (print, safety deposit box, etc.)Delete any plaintext copies of the secret.
| Platform | App | Connection |
|---|---|---|
| Android | Keepass2Android | USB-C or NFC |
| iPad | Strongbox or KeePassium | USB-C only |
# Kill gpg-agent (often holds exclusive lock)
gpgconf --kill gpg-agent
# Ensure pcscd is running
sudo systemctl start pcscdykman list --serials
ykman --device <SERIAL> otp info- Slot 1 is often used for Yubico OTP (web auth) - don't overwrite
- GPG keys use a separate applet and are unaffected
--touchrequires physical touch for each unlock (recommended)- Without the secret backed up, a lost YubiKey = lost database access