tech:cheatsheets:linux:luks
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tech:cheatsheets:linux:luks [2024/01/15 07:32] – removed - external edit (Unknown date) 127.0.0.1 | tech:cheatsheets:linux:luks [2024/09/27 07:46] (current) – waldemar | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== LUKS ====== | ||
| + | ===== Mount encrypted partition ===== | ||
| + | <code bash> | ||
| + | cryptsetup luksOpen / | ||
| + | mount / | ||
| + | </ | ||
| + | |||
| + | ==== Grow partition ==== | ||
| + | Note: filesystem should not be mounted when resizing | ||
| + | * https:// | ||
| + | ===== Change key of encrypted partition ===== | ||
| + | <code bash> | ||
| + | cryptsetup luksChangeKey /dev/sdX | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Extend encrypted partition ===== | ||
| + | * https:// | ||
| + | |||
| + | ===== Setup automatic unlock ===== | ||
| + | <code bash> | ||
| + | apt install -y clevis clevis-luks clevis-udisks2 clevis-systemd clevis-tpm2 clevis-initramfs | ||
| + | clevis luks bind -d / | ||
| + | systemctl enable clevis-luks-askpass.path | ||
| + | update-initramfs -u -k all | ||
| + | </ | ||
| + | |||
| + | ==== Troubleshooting ==== | ||
| + | If it doesn' | ||
| + | The PCR banks can be checked with '' | ||
| + | ==== Regenerate ==== | ||
| + | If automatic unlock does not work anymore it needs to be regenerated. | ||
| + | First list the used slots: | ||
| + | <code bash> | ||
| + | clevis luks list -d / | ||
| + | </ | ||
| + | |||
| + | Then regenerate the used slot: | ||
| + | <code bash> | ||
| + | clevis luks regen -d / | ||
| + | </ | ||
| + | |||
| + | ==== Change PCRs ==== | ||
| + | To change PCRs you first need to delete the key and then re-add using the wanted PCRs. | ||
| + | |||
| + | List the used slots: | ||
| + | <code bash> | ||
| + | clevis luks list -d / | ||
| + | </ | ||
| + | |||
| + | Remove the slot: | ||
| + | <code bash> | ||
| + | clevis luks unbind -d / | ||
| + | </ | ||
| + | Note: '' | ||
| + | |||
| + | After that re-add the key like above. | ||
| + | |||
| + | ===== References ===== | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||