Encrypted swap

From blag.wiki.aktivix.org

Jump to: navigation, search

Here's a quick & dirty way to do encrypted swap...

Comment the swap line out of /etc/fstab.

Add this to /etc/rc.d/rc.local

echo "Setting up encrypted swap"
swapoff -a
cryptsetup remove swap
cryptsetup --key-file=/dev/random --key-size=256 --cipher=twofish-cbc-essiv:sha256 create swap /dev/hda2
mkswap /dev/mapper/swap
swapon /dev/mapper/swap

Be sure to substitute your swap partition for /dev/hda2!!!

Personal tools