# systemd-cryptenroll --tpm2-device=auto /dev/sdb1
Please enter current passphrase for disk /dev/sdb1: ••••••••
New TPM2 token enrolled as key slot 1.
Или, указав PCR, которые будут использоваться для привязки ключа к состоянию BIOS/загрузчика:
# systemd-cryptenroll /dev/sdb1 --tpm2-device=auto --tpm2-pcrs=0,2,4,7
Please enter current passphrase for disk /dev/sdb1: ••••••••
New TPM2 token enrolled as key slot 1.
Примечание
# cryptsetup luksDump /dev/sdb1 | grep -i keyslot
Keyslots area: 16744448 [bytes]
Keyslots:
Keyslot: 1
# cryptsetup luksUUID /dev/sdb1
cec42bd7-861f-4993-92c6-42be634af1a5
/etc/crypttab, указав UUID диска:
sdb1_encrypted UUID=cec42bd7-861f-4993-92c6-42be634af1a5 none luks,discard
# systemd-cryptenroll /dev/sdb1 \
--tpm2-device=auto \
--tpm2-pcrs=0+2+4+7 \
--tpm2-with-pin=yes
🔐 Please enter current passphrase for disk /dev/sdb1: ••••••••
🔐 Please enter TPM2 PIN: ••••••••
🔐 Please enter TPM2 PIN (repeat): ••••••••
New TPM2 token enrolled as key slot 1.
# cryptsetup luksDump /dev/sdb1 | grep -i keyslot
Keyslots area: 16744448 [bytes]
Keyslots:
Keyslot: 1
# cryptsetup luksUUID /dev/sdb1
cec42bd7-861f-4993-92c6-42be634af1a5
/etc/crypttab, указав UUID диска:
sdb1_encrypted UUID=cec42bd7-861f-4993-92c6-42be634af1a5 none luks,discard