386 Words

2. First-Time Setup — The Bare Minimum

← 1. Installation · Overview · Next: 3. TOTP codes →

Every YubiKey leaves the factory with the same, publicly known defaults. Until you change them, anybody who holds your key can use it.

✅ Do this checklist for every YubiKey you own, including the backup key.

✔ApplicationWhat to changeDefault
☐FIDO2Set a PIN(none)
☐PIVPIN123456
☐PIVPUK12345678
☐PIVManagement key010203040506070801020304050607080102030405060708
☐OpenPGPUser PIN123456
☐OpenPGPAdmin PIN12345678
☐OATHPassword(none) — see chapter 3

💾 Write down your PUK, Admin PIN and management key and store them offline (paper, or a QR code in a safe). I have an instruction for making a QR code in the CLI here.


2.1 Check the key

ykman info

You should see your device type, serial number and enabled applications (see chapter 1).


2.2 FIDO2 — set a PIN

ykman fido info                 # shows "PIN: Not set" on a new key
ykman fido access change-pin    # leave "current PIN" empty on a new key

Verify:

ykman fido access verify-pin
ykman fido credentials list     # must ask for your PIN

Optional — always require the PIN (User Verification) for FIDO2:

ykman fido config toggle-always-uv

2.3 PIV (smartcard) — PIN, PUK and management key

ykman piv access change-pin     # default 123456
ykman piv access change-puk     # default 12345678

Change the management key. Option A (recommended): generate a random key and protect it with your PIN, so you don’t have to remember it:

ykman piv access change-management-key --generate --protect

Option B: generate a key and store it yourself (offline, printed, QR …):

ykman piv access change-management-key --generate

Older firmware may need an explicit algorithm, e.g. -a TDES.


2.4 OpenPGP — User PIN and Admin PIN

💡 Planning to use OpenPGP (chapter 5)? Do the KDF setup in section 5.2 first, then come back here. KDF must be enabled while the PINs are still the defaults.

ykman openpgp access change-pin          # default 123456
ykman openpgp access change-admin-pin    # default 12345678

2.5 Done?

Run this quick check — every command should now ask for your own PIN, not a default one:

ykman fido credentials list
ykman piv info
ykman openpgp info

← 1. Installation · Overview · Next: 3. TOTP codes →