TL;DR run dracut --regenerate-all --force
So I found the problem, I didn't execute dracut --regenerate-all --force
after modifying /etc/crypttab
before rebooting. I believe on Debian based distros you would need to run update-initramfs -u
instead. When requiring a FIDO2 PIN it is entered at the Plymouth interface. It looks identical to when entering a LUKS passphrase but if you hit Esc you will see the prompt asking for the FIDO2 token PIN instead.
For reference here is a complete procedure for configuring a FIDO2 token (e.g. YubiKey) to unlock a LUKS volume on a RH/Fedora distro (Note: This is only supported from systemd version 248. systemctl --version
to check.)
- View existing LUKS keyslot info. If initially configured to use only a passphrase you will see only one keyslot (slot 0) and zero tokens.
cryptsetup luksDump /dev/sda3
(Replace sda3 with whatever your block device is)
- Enroll token(s). In this example, specifying a requirement for FIDO2 PIN and user presence (e.g. 'touch').
systemd-cryptenroll --fido2-device=auto --fido2-with-client-pin=true --fido2-with-user-presence=true /dev/sda3
- Check LUKS token(s) and keyslots again. This time you should see an addition keyslot (slot 1) and a new token (token 0) which will also list the above parameters if specified during enrollment.
cryptsetup luksDump /dev/sda3
- Modify /etc/crypttab. By default on Fedora 36 it will be using UUIDs.
vim /etc/crypttab
Modify so it looks like this.
luks-a6c32afd-3c35-4628-8653-5be499eaf0ce UUID=a6c32afd-3c35-4628-8653-5be499eaf0ce - fido2-device=auto
- Generate new initramfs image
dracut --regenerate-all --force
- Reboot and test. As mentioned the Plymouth splash screen will look the same but instead of entering a LUKS passphrase, enter the FIDO2 PIN instead. Or press 'Esc' to verify that it is actually prompting for the FIDO2 PIN, if required. If the presence requirement was specified, you will need to touch the token. The system should boot.
Extras:
To remove a token from a LUKS volume.
cryptsetup token remove --token-id 0 /dev/sda3
And to remove the corresponding key slot.
systemd-cryptenroll --wipe-slot=1 /dev/sda3
A peculiarity I've noticed if enrolling multiple FIDO2 tokens and specifying a PIN and presence requirement is that you will need to touch the token X number of times, where X is the n'th token that's been enrolled. E.g. If you enroll four tokens, when using the 4th enrolled token, you will need to touch it four times before the system boots. I think it's related to this mention in SYSTEMD-CRYPTENROLL(1):
Also note that support for enrolling multiple FIDO2 tokens is
currently not too useful, as while unlocking systemd-cryptsetup cannot
identify which token is currently plugged in and thus does not know
which authentication request to send to the device.