Encrypted home on multiuser system
Version: 2006.07.07 13:29

The goal
- Encrypted home partition of selected user.
- Nice gnome integration. Only one additional window while that user logs in. Automatic locking up the partition after logout.
- No changes visible to other users of the computer. Their login procedure shouldn't change at all.
Solution
I'm using Ubuntu, if you prefer other distribution you may need to adjust some details.
If you find any problems, please mail me.
- Install required packages
apt-get install cryptsetup
apt-get install zenity
- Encrypt swap partition
- Prepare your home partition. Cryptsetup will ask for a passphrase - make sure it's shorter than 32 characters. You can of course change cipher specification string, and filesystem type.
dd if=/dev/random of=/dev/my_home_partition
cryptsetup create --cipher=aes-cbc-essiv:sha256 -y my_home /dev/my_home_partition
mkfs.xfs /dev/mapper/my_home
cryptsetup remove my_home
- Copy my sezam script to /usr/local/bin/sezam
- Edit/usr/local/bin/sezam. Find the first case statement and change user to your user name.
case "$USER" in
user)
DEVICE=/dev/user_home_partition
;;
- Edit /etc/gdm/PostLogin/Default
#!/bin/sh
/usr/local/bin/sezam open $USER
exit $?
- Edit /etc/gdm/PostSession/Default. Add the following line just before end of script
...
/usr/local/bin/sezam close $USER &
exit 0