TPM unlock¶
With a tpm2 entry the agent binds LUKS volumes to the TPM 2.0, so the disk opens at boot
without a passphrase as long as the measured boot state is unchanged:
pcrs: the PCRs the key is sealed to, default 7 (Secure Boot state and its certificates). Add 0, 2 or 4 for firmware and boot loader measurements; every firmware or boot loader update then needs the recovery key once and a new binding.pin: the TPM also needs a PIN at boot.require: the compliance checkdisk.tpmfails while a volume is not bound. Without it the check only reports the state.
How it works:
- Binding needs a current key of the volume. The agent holds one only right after a recovery
key was created or rotated, so a volume is bound when the server confirmed its new
recovery key:
systemd-cryptenroll --unlock-key-file=<recovery key> --tpm2-device=auto --tpm2-pcrs=7 --wipe-slot=tpm2. The key file lives in a private tmpfs directory and is removed right after. - The recovery key slot stays; only an earlier TPM2 slot is replaced, so a changed PCR list applies with the next binding.
- Volumes escrowed before the
tpm2entry are bound with their next key rotation: view the key in the console withrotate_after_view, or runsudo limdm-agent recovery-key --all. - With
pinthe agent never binds by itself, because only the user may know the PIN.sudo limdm-agent recovery-key --allasks for the passphrase, adds a new recovery key, asks for a PIN (at least 6 characters, twice) and binds the volume. The PIN goes tosystemd-cryptenrollin its environment, never on the command line. - Where dracut builds the initrd (Fedora, SUSE, Arch with dracut) the agent adds
/etc/dracut.conf.d/60-limdm-tpm2.confwith thetpm2-tssmodule and runsdracut -f --regenerate-allonce. Debian and Ubuntu with initramfs-tools cannot unseal a TPM2 key at boot; there the binding exists but the passphrase prompt stays until the initrd uses dracut or systemd.
Requirements: a TPM 2.0 (/sys/class/tpm/tpm0), LUKS2 and systemd 252 or newer
(--unlock-key-file). The device page shows the TPM version and the bound volumes in the
Hardware tab; the inventory reports them as tpm.
Lost mode removes every key slot except the recovery key, the TPM slot included; the agent binds again only with the next escrowed recovery key.