Auto Mount the Encrypted Home Partition

Environment
  • Ubuntu 10.04 x64

Introduction
Mount the encrypted home partition automatically when login


Solutions
The passpharse must be the same as the password of the user account

Firstly, Install libpam-mount
#apt-get install libpam-mount
Edit /etc/crypttab. The target is the mapping name
#<target>   <source device>   <key file>   <options>
cryptohome   /dev/sda2   noauto   luks

Edit /etc/security/pam_mount.conf.xml, set the volume definitions to be
<!-- Volume definitions -->
<volume user="username" fstype="crypt" path="/dev/sda2" mountpoint="/home" />
More can visit Encrypted swap, tmp and home partition in Ubuntu 9.04


References