These steps document how to activate home folder encryption for an existing user account on elementary OS 5.1 Hera.
sudo add-apt-repository universe sudo apt update sudo apt install ecryptfs-utils cryptsetup
Go to Applications > System Settings > User Accounts, click ”+” in the lower left corner and a new user with the following settings:
Click Create User.
Open a Terminal and execute the following commands:
sudo ecryptfs-migrate-home -u <username>
Next up we’ll login with our regular user. This finishes the home encryption.
If everything went well, we remove the home directory backup:
sudo rm -rf /home/<username>.<hash>
We also delete the temporary user in the System Settings and make sure its home directory is removed:
sudo rm -rf /home/homecrypt