Encrypt home directory after install

The following method could be use to encrypt a users /home directory after installing Trisquel.

The package needed is ecryptfs-utils. To install this package use the following command apt-get install ecryptfs-utils cryptsetup

0) First of all, make sure the user is logged out of the system, else the files in his /home directory might be locked.
You need to run this as another user with sudo privileges or as root.

1) Execute the command ecryptfs-migrate-home -u TheUserName
This command will migrate or encrypt the users /home directory.

2) login as the user - TheUserName.
The user needs to login before a reboot, this to finish off the migration of the users /home directory

3) Execute the command ecryptfs-setup-swap
This command will encrypt your swap directory.

4) Delete the backup which was created by ecryptfs-migrate-home script.
Usually you find this under /home/TheUserName.SomeRandomNumber

5) As the user which has got it's /home encrypted, run the following command ecryptfs-unwrap-passphrase
This to record a randomly generated mount passphrase.


10/04/2015 - 07:35