encryption:luks-partition
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| encryption:luks-partition [2021/11/10 00:11] – ↷ Page name changed from encryption:luks to encryption:luks-partition chuck | encryption:luks-partition [2021/11/10 00:17] (current) – chuck | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======LUKS====== | + | ======LUKS |
| ---- | ---- | ||
| - | =====LUKS Encrypted Partition/ | + | =====Change LUKS Partition Password===== |
| - | ====Change LUKS Partition Password==== | + | |
| * Find the drive with the luks headers:< | * Find the drive with the luks headers:< | ||
| cat / | cat / | ||
| Line 30: | Line 29: | ||
| ---- | ---- | ||
| - | ====Unlock LUKS Partition from GRUB==== | + | =====Unlock LUKS Partition from GRUB===== |
| * Insert luks module:< | * Insert luks module:< | ||
| grub rescue> insmod luks | grub rescue> insmod luks | ||
| Line 40: | Line 39: | ||
| grub rescue> cryptomount (hd0,gpt2) | grub rescue> cryptomount (hd0,gpt2) | ||
| </ | </ | ||
| - | * To use uuid instead, use the '' | + | * To use uuid instead, use the '' |
| + | grub rescue> cryptomount -u 8f5fc81c-41bb-11ec-81d3-0242ac130003 | ||
| + | </ | ||
| * Enter passphrase:< | * Enter passphrase:< | ||
| Attempting to decrypt master key... | Attempting to decrypt master key... | ||
| Line 57: | Line 58: | ||
| grub rescue> normal | grub rescue> normal | ||
| </ | </ | ||
| - | * https:// | ||
| - | * https:// | ||
| ---- | ---- | ||
| - | =====LUKS Encrypted Storage===== | + | =====Links===== |
| - | + | * https://www.gnu.org/software/grub/manual/grub/html_node/Commands.html# | |
| - | <WRAP tip> | + | * https://www.gnu.org/software/grub/manual/grub/html_node/GRUB-only-offers-a-rescue-shell.html# |
| - | With cryptsetup 2.1.0, the LUKS header takes up just under 16MiB, so the partition size must be 16MiB + the size of the data you want to store in it. | + | |
| - | </ | + | |
| - | + | ||
| - | ====Create a LUKS Storage Container==== | + | |
| - | * Create a 20Mb file filled with random data: ((https://pthree.org/2012/02/20/randomize-first-the-encrypt-your-block-device/))< | + | |
| - | sudo dd if=/dev/urandom of=encrypted.luks.img iflag=fullblock bs=1M count=20 | + | |
| - | </ | + | |
| - | * Switch to root:< | + | |
| - | sudo -s | + | |
| - | </code> | + | |
| - | * Set permissions:< | + | |
| - | chmod go= encrypted.luks.img | + | |
| - | </code> | + | |
| - | * Configure encryption:< | + | |
| - | cryptsetup --verbose luksFormat encrypted.luks.img | + | |
| - | cryptsetup --verbose --use-random luksFormat encrypted.luks.img | + | |
| - | </code> | + | |
| - | * Open the encrypted container:< | + | |
| - | cryptsetup --verbose luksOpen encrypted.luks.img encrypted | + | |
| - | </code> | + | |
| - | * Create filesystem:< | + | |
| - | mkfs.ext4 | + | |
| - | </code> | + | |
| - | * Create directory to mount the container:< | + | |
| - | mkdir / | + | |
| - | </ | + | |
| - | * Mount the container:< | + | |
| - | mount -t ext4 -o journal_checksum / | + | |
| - | </ | + | |
| - | * Chown it:< | + | |
| - | chown chuck: / | + | |
| - | </ | + | |
| - | * Set permissions:< | + | |
| - | chmod go= / | + | |
| - | </ | + | |
| - | * Switch back to $USER:< | + | |
| - | exit | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | ---- | + | |
| - | ====Copy Files to the LUKS Storage Container==== | + | |
| - | * Copy or create your files:< | + | |
| - | cp / | + | |
| - | </ | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | ====Close the LUKS Storage Container and Lock it==== | + | |
| - | * Switch to root:< | + | |
| - | sudo -s | + | |
| - | </ | + | |
| - | * Unmount the container:< | + | |
| - | umount / | + | |
| - | </ | + | |
| - | * Close the encrypted container:< | + | |
| - | cryptsetup luksClose encrypted | + | |
| - | </ | + | |
| - | * Switch back to $USER:< | + | |
| - | exit | + | |
| - | </ | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | ====Change Password on a LUKS Encrypted Storage Container==== | + | |
| - | * If you want/need to change the password:< | + | |
| - | sudo cryptsetup luksChangeKey encrypted.luks.img | + | |
| - | </ | + | |
| - | + | ||
| - | ---- | + | |
encryption/luks-partition.1636503114.txt.gz · Last modified: by chuck
