debian grimoire |
Encrypted Swap
How to set up encrypted swap.
randomly encrypted swap¶turn off swap:
Look in /etc/fstab for what partitions are swap. In my case, it will be /dev/sda2 and /dev/sdb2. Comment these out and replace them with encrypted swap devices (which we will create later):
Run the cryptdisks startup script to create /dev/mapper/swapX from /etc/crypttab entries:
Turn swap back on:
hibernation with encrypted swap¶If you want to be able to hibernate (suspend to disk) then swap must be encrypted with a non-random key. about hibernation¶There are three methods of hibernation: swsusp, uswsusp (aka suspend), and tuxonice (aka suspend2). See comparison of methods and the ubuntu suspend pages. setup encrypted swap for uswsusp¶Install the cryptsetup package¶
Setup the encrypted partition:¶
Add this line to /etc/crypttab:¶
Set the swap partition to be this in /etc/fstab:¶
activate new swap¶
You can check to see what swap is active:
Configure uswsusp to use /dev/mapper/cswap and write unencrypted data¶install or reconfigure uswsusp:
or
or, you could just edit the config /etc/uswsusp.conf and run:
codetitle. /etc/uswsusp.conf
making gnome hibernate button work with uswsusp¶THIS DOES NOT WORK ANYMORE, BECAUSE NOW HAL SCRIPTS WONT TRY OTHER METHODSthe hal scripts that govern what happens when you hit hibernate in the gnome logout dialog will use pmi scripts first. We can’t remove the pmi package, because that will remove gnome-desktop. However, we can divert the scripts to a disabled path name. This way, the hal scripts will use uswsusp first.
undo the divert:
testing¶
see if that works.
|