Member-only story

Perils of Encrypting your Home Folder on Ubuntu

Forketyfork
6 min readSep 16, 2020

--

Image by meineresterampe from Pixabay

Encrypting an existing user home folder in Ubuntu should be a single-command task, but it got tricky for me with some complications. I’ll try to explain what issues I had and how I fixed them. I used the latest LTS 20.04.1 version of Ubuntu.

First off, you’ll probably want to encrypt the whole drive instead, since some sensitive data may reside not only in your home folder but also outside of it. For instance, you should definitely encrypt the swap file in addition to home folder encryption, as the swap file may contain all kinds of sensitive information offloaded from the memory.

This article will cover both encrypting the home directory, and encrypting the swap file.

Once again, home folder encryption is tricky, and it may ruin your home folder, so first, do a backup. Please use this guide at your own risk.

Encrypting the home folder

Start with installing eCryptFS:

sudo apt install ecryptfs-utils cryptsetup

Now you’ll need an additional local administrator user to encrypt your home folder, since when you’re logged in, some of the files in this folder may be open or inaccessible. To make sure you don’t loose anything during the encryption, this process has to be done from another user. The…

--

--

Forketyfork
Forketyfork

Written by Forketyfork

Software developer @ JetBrains CodeCanvas. I write technical how-to articles and occasional rants on software development in general. Opinions are my own.

No responses yet