This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
computing:encryption [2018/10/16 21:04] – created oemb1905 | computing:encryption [2024/01/29 18:01] – oemb1905 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
------------------------------------------- | ------------------------------------------- | ||
* **encryption** | * **encryption** | ||
Line 8: | Line 7: | ||
------------------------------------------- | ------------------------------------------- | ||
- | Boot into the ncurses installer, when prompted to set up disks for partitioning, | + | Creating a encrypted partition |
+ | |||
+ | sudo apt-get install cryptsetup libpam-mount | ||
+ | cryptsetup luksFormat /dev/sdaX | ||
+ | cryptsetup luksOpen /dev/sdaX vault | ||
+ | mkfs.xfs -L vault / | ||
+ | |||
+ | To manually mount the vault, | ||
+ | |||
+ | mkdir / | ||
+ | mount / | ||
+ | |||
+ | After you reboot, | ||
+ | |||
+ | cryptsetup luksOpen /dev/sdaX vault | ||
+ | mount / | ||
+ | |||
+ | Okay, so if mounting manually proves to be too tedious, here is how you can mount at boot. First, create a keyfile that you can use to unlock the crypt (only store this on an encrypted drive): | ||
+ | |||
+ | sudo dd if=/ | ||
+ | |||
+ | Add the keyfile to the crypt so that it can be used to open the crypt: | ||
+ | |||
+ | sudo cryptsetup -v luksAddKey | ||
+ | |||
+ | Now, we need to get the partition's block identifier, to use in crypttab and fstab because it is more reliable than the name. | ||
+ | |||
+ | sudo cryptsetup luksDump /dev/sdb1 | grep " | ||
+ | |||
+ | Open crypttab up, and add the example below, adjusting as necessary. | ||
+ | |||
+ | sudo nano / | ||
+ | < | ||
+ | |||
+ | Now that crypttab | ||
+ | |||
+ | sudo cryptdisks_start sdb1_crypt | ||
+ | |||
+ | But, since this only opens it and does not mount it, you will need to add an entry to fstab similar to the one provided below: | ||
+ | |||
+ | sudo nano / | ||
+ | </ | ||
+ | |||
+ | Alternately, | ||
+ | |||
+ | 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=" | ||
+ | |||
+ | Remove | ||
+ | |||
+ | sudo nano / | ||
+ | < | ||
+ | --- // |