systemd-cryptenroll(1)
| SYSTEMD-CRYPTENROLL(1) | systemd-cryptenroll | SYSTEMD-CRYPTENROLL(1) |
NAME
systemd-cryptenroll - Enroll PKCS#11, FIDO2, TPM2 token/devices to LUKS2 encrypted volumes
SYNOPSIS
systemd-cryptenroll [OPTIONS...] [DEVICE]
DESCRIPTION
systemd-cryptenroll is a tool for enrolling hardware security tokens and devices into a LUKS2 encrypted volume, which may then be used to unlock the volume during boot. Specifically, it supports tokens and credentials of the following kind to be enrolled:
In addition, the tool may be used to enumerate currently enrolled security tokens and wipe a subset of them. The latter may be combined with the enrollment operation of a new security token, in order to update or replace enrollments.
The tool supports only LUKS2 volumes, as it stores token meta-information in the LUKS2 JSON token area, which is not available in other encryption formats.
LIMITATIONS
Note that currently when enrolling a new key of one of the five supported types listed above, it is required to first provide a passphrase or recovery key (i.e. one of the latter two key types). For example, it's currently not possible to unlock a device with a FIDO2 key in order to enroll a new FIDO2 key. Instead, in order to enroll a new FIDO2 key, it is necessary to provide an already enrolled regular passphrase or recovery key. Thus, if in future key roll-over is desired it's generally recommended to combine TPM2, FIDO2, PKCS#11 key enrollment with enrolling a regular passphrase or recovery key.
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. This limitation does not apply to tokens enrolled via PKCS#11 — because tokens of this type may be identified immediately, before authentication.
OPTIONS
The following options are understood:
--password
--recovery-key
--pkcs11-token-uri=URI
In order to unlock a LUKS2 volume with an enrolled PKCS#11 security token, specify the pkcs11-uri= option in the respective /etc/crypttab line:
myvolume /dev/sda1 - pkcs11-uri=auto
See crypttab(5) for a more comprehensive example of a systemd-cryptenroll invocation and its matching /etc/crypttab line.
--fido2-device=PATH
In order to unlock a LUKS2 volume with an enrolled FIDO2 security token, specify the fido2-device= option in the respective /etc/crypttab line:
myvolume /dev/sda1 - fido2-device=auto
See crypttab(5) for a more comprehensive example of a systemd-cryptenroll invocation and its matching /etc/crypttab line.
--fido2-with-client-pin=BOOL
--fido2-with-user-presence=BOOL
--fido2-with-user-verification=BOOL
--tpm2-device=PATH
In order to unlock a LUKS2 volume with an enrolled TPM2 security chip, specify the tpm2-device= option in the respective /etc/crypttab line:
myvolume /dev/sda1 - tpm2-device=auto
See crypttab(5) for a more comprehensive example of a systemd-cryptenroll invocation and its matching /etc/crypttab line.
Use --tpm2-pcrs= (see below) to configure which TPM2 PCR indexes to bind the enrollment to.
--tpm2-pcrs= [PCR...]
Table 1. Well-known PCR Definitions
| PCR | Explanation |
| 0 | Core system firmware executable code; changes on firmware updates |
| 1 | Core system firmware data/host platform configuration; typically contains serial and model numbers, changes on basic hardware/CPU/RAM replacements |
| 2 | Extended or pluggable executable code; includes option ROMs on pluggable hardware |
| 3 | Extended or pluggable firmware data; includes information about pluggable hardware |
| 4 | Boot loader; changes on boot loader updates |
| 5 | GPT/Partition table; changes when the partitions are added, modified or removed |
| 6 | Power state events; changes on system suspend/sleep |
| 7 | Secure boot state; changes when UEFI SecureBoot mode is enabled/disabled |
| 8 | sd-boot(7) measures the kernel command line in this PCR. |
--wipe-slot= [SLOT...]
This switch may be used alone, in which case only the requested wipe operation is executed. It may also be used in combination with any of the enrollment options listed above, in which case the enrollment is completed first, and only when successful the wipe operation executed — and the newly added slot is always excluded from the wiping. Combining enrollment and slot wiping may thus be used to update existing enrollments:
systemd-cryptenroll /dev/sda1 --wipe-slot=tpm2 --tpm2-device=auto
The above command will enroll the TPM2 chip, and then wipe all previously created TPM2 enrollments on the LUKS2 volume, leaving only the newly created one. Combining wiping and enrollment may also be used to replace enrollments of different types, for example for changing from a PKCS#11 enrollment to a FIDO2 one:
systemd-cryptenroll /dev/sda1 --wipe-slot=pkcs11 --fido2-device=auto
Or for replacing an enrolled empty password by TPM2:
systemd-cryptenroll /dev/sda1 --wipe-slot=empty --tpm2-device=auto
-h, --help
--version
EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise.
SEE ALSO
systemd(1), systemd-cryptsetup@.service(8), crypttab(5), cryptsetup(8)
| systemd 249 |
