大网数据广告活动
Linux 与通用命令

systemd-cryptenroll · 常用命令示例

· 52CE 我爱测

Interactively enroll or remove methods used to unlock LUKS2-encrypted devices. Uses a password to unlock the device unless otherwise specified. > In order to allow a partition to be unlocked during system boot, update the `/etc/crypttab` file or the initramfs. > More information:

systemd-cryptenroll

Interactively enroll or remove methods used to unlock LUKS2-encrypted devices. Uses a password to unlock the device unless otherwise specified. In order to allow a partition to be unlocked during system boot, update the /etc/crypttab file or the initramfs. More information: https://www.freedesktop.org/software/systemd/man/latest/systemd-cryptenroll.html.

  • Enroll a new password (similar to cryptsetup luksAddKey):

systemd-cryptenroll --password

  • Enroll a new recovery key (i.e. a randomly generated passphrase that can be used as a fallback):

systemd-cryptenroll --recovery-key

  • List available tokens, or enroll a new PKCS#11 token:

systemd-cryptenroll --pkcs11-token-uri

  • List available FIDO2 devices, or enroll a new FIDO2 device (auto can be used as the device name when there is only one token plugged in):

systemd-cryptenroll --fido2-device

  • Enroll a new FIDO2 device with user verification (biometrics):

systemd-cryptenroll --fido2-device --fido2-with-user-verification yes

  • Unlock using a FIDO2 device, and enroll a new FIDO2 device:

systemd-cryptenroll --unlock-fido2-device --fido2-device

  • Enroll a TPM2 security chip (only secure-boot-policy PCR) and require an additional alphanumeric PIN:

systemd-cryptenroll --tpm2-device --tpm2-with-pin yes

  • Remove all empty passwords/all passwords/all FIDO2 devices/all PKCS#11 tokens/all TPM2 security chips/all recovery keys/all methods:

systemd-cryptenroll --wipe-slot

来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
tldr-pages contributors
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。