Quick Linux Tip #110:
Question: My encrypted data disk needs password every boot. How do I automate it safely?
Try: sudo cryptsetup luksAddKey /dev/sdb1 /root/keyfile.bin
Info: Adds a keyfile slot to LUKS for automated boot decryption.
Examples:
- $
sudo cryptsetup luksDump /dev/sdb1# Inspect active LUKS key slots - $
sudo cryptsetup luksRemoveKey /dev/sdb1# Revoke a specific key slot - $
sudo cryptsetup luksChangeKey /dev/sdb1# Update an existing passphrase
Note: Storing a keyfile unencrypted on the same drive defeats security. Use separate keys, TPM 2.0 (systemd-cryptenroll), or network unlocking (Clevis/Tang) for production.
Leave a Reply