Table of Contents

Encrypt your home folder (Unfortunately not suitable for Debian 10)

By encrypting your home folder, you make it impossible for someone who steals your laptop to see the files in your personal home folder.

Remember that your home folder is:

/home/<username>

where <username> is your Debian username.

Prerequisites

Following the steps in this manual require free disk space 2.5x the current size of the home directory. Once successful, you can recover most of this space by deleting the cleartext directory.

Backup

First of all, you should make regular backups already. Before encrypting your home folder, make another backup like your regular ones.

Migration

Install the encryption migration tool:

sudo apt install ecryptfs-utils lsof rsync

Reboot your laptop:

sudo reboot

Switch to tty3:

Ctrl + Alt + F3

Log in to your root account:

sudo ecryptfs-migrate-home -u <username>

The encryption process can take a while depending on the size of your /home folder.

After the process completes, reboot your laptop.

Finish the migration

Log in to your own <username> account. The migration resulted in two folders in your /home folder:

Check if everything still works, if your documents are accessible and whether the two folders are equal in size.

Then, remove the backup folder that was made during the process. In this guide, we overwrite it several times so that it cannot be recovered.

Find out the backup folder name:

cd /home
ls

There should be a folder <username>.<randomstring>.

Change directory to this folder:

cd <username>.<randomstring>

Overwrite it:

find . -exec shred -n1 {} \;

This can take a while.

Remove the backup folder:

rm -r .

Congratulations, you have encrypted your home folder!