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] – ↷ Page moved from infrastructure:cheatsheets:linux:luks to tech:cheatsheets:linux:luks waldemar | tech:cheatsheets:linux:luks [2024/09/27 07:46] (current) – waldemar | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| <code bash> | <code bash> | ||
| cryptsetup luksOpen / | cryptsetup luksOpen / | ||
| - | mount / | + | 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 ===== | ===== Extend encrypted partition ===== | ||
| Line 11: | Line 20: | ||
| ===== Setup automatic unlock ===== | ===== Setup automatic unlock ===== | ||
| <code bash> | <code bash> | ||
| - | apt install -y initramfs | + | apt install -y clevis clevis-luks clevis-udisks2 clevis-systemd clevis-tpm2 clevis-initramfs |
| clevis luks bind -d / | clevis luks bind -d / | ||
| systemctl enable clevis-luks-askpass.path | systemctl enable clevis-luks-askpass.path | ||
| Line 17: | Line 26: | ||
| </ | </ | ||
| + | ==== Troubleshooting ==== | ||
| + | If it doesn' | ||
| + | The PCR banks can be checked with '' | ||
| ==== Regenerate ==== | ==== Regenerate ==== | ||
| If automatic unlock does not work anymore it needs to be regenerated. | If automatic unlock does not work anymore it needs to be regenerated. | ||
| Line 28: | Line 40: | ||
| clevis luks regen -d / | 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 ===== | ===== References ===== | ||
| Line 36: | Line 64: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
tech/cheatsheets/linux/luks.1705303959.txt.gz · Last modified: by waldemar