This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
computing:encryption [2018/11/28 06:07] – oemb1905 | computing:encryption [2025/03/09 18:11] (current) – oemb1905 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
------------------------------------------- | ------------------------------------------- | ||
* **encryption** | * **encryption** | ||
Line 8: | Line 7: | ||
------------------------------------------- | ------------------------------------------- | ||
- | More later ... | + | To use pam_mount to mount a LUKS crypt and map it to your home partition. Note: make sure the crypt password matches your user login password. |
+ | |||
+ | sudo apt-get install cryptsetup libpam-mount rsync | ||
+ | rsync -av /home /backup | ||
+ | umount /home/ | ||
+ | cryptsetup luksFormat /dev/sdaX | ||
+ | cryptsetup luksOpen /dev/sdaX home | ||
+ | mkfs.xfs -L home / | ||
+ | mount / | ||
+ | rsync -av / | ||
+ | sudo nano / | ||
+ | <volume user=" | ||
+ | |||
+ | To use pam_mount to mount a LUKS crypt to a non-home directory partition, then adjust as follows: | ||
+ | |||
+ | cryptsetup luksFormat /dev/sdaX | ||
+ | cryptsetup luksOpen /dev/sdaX vault | ||
+ | mkfs.xfs -L vault / | ||
+ | mkdir / | ||
+ | mount / | ||
+ | sudo nano / | ||
+ | <volume user=" | ||
+ | |||
+ | You may optionally mount the LUKS crypt manually as well. To do so, create a mount point, and then map the LUKS partion to your mount point. | ||
+ | |||
+ | mkdir / | ||
+ | mount / | ||
+ | |||
+ | After you reboot, the crypt will no longer be open, but your mount point will still be there, so you just need to open the LUKS crypt and then map the LUKS partition to your mount point again as follows: | ||
+ | |||
+ | cryptsetup luksOpen /dev/sdaX vault | ||
+ | mount / | ||
+ | |||
+ | Users might also to prefer to use crypttab and fstab to handle the mounting and mapping. To do so, let's create a keyfile in a secure location that you can use to unlock the crypt. | ||
+ | |||
+ | sudo dd if=/ | ||
+ | |||
+ | Add the keyfile to the LUKS crypt so that it can be used to open the crypt: | ||
+ | |||
+ | sudo cryptsetup -v luksAddKey /dev/sdaX / | ||
+ | |||
+ | After adding the key to the crypt, let's now grab the UUID of the crypt. | ||
+ | |||
+ | sudo cryptsetup luksDump /dev/sdaX | grep " | ||
+ | |||
+ | Now that we have the UUID of the crypt, we can add a reliable crypttab entry for the crypt. | ||
+ | |||
+ | sudo nano / | ||
+ | < | ||
+ | |||
+ | Now that crypttab is setup, this means you you can open the crypt as follows. | ||
- | These notes are for setting up dual boot with full disk encryption | + | sudo cryptdisks_start sdaX_crypt |
+ | |||
+ | If you want, however, the crypt to mount on its own, then add an entry to fstab as well. | ||
- | Boot into the ncurses installer, when prompted to set up disks for partitioning, | + | sudo nano / |
+ | </ | ||
+ | |||
+ | Okay, your LUKS crypt should now be open and mapped | ||
+ | sudo nano / | ||
+ | < | ||
+ | --- // |