Linux home directory encryption

Sharing is caring!

Encrypting the $HOME directory under ubuntu/debian and other dists.
In my case my $USER is “ubuntu” so be careful to replace that with your own user.
Be sure to have more than the double free space in your $HOME than the size of the files to complete the migration, else copy your files temporarily in another partition and after the encryption put them back.

First install the required packages: rsync lsof ecryptfs-utils

Then we must login as another user to encrypt our $HOME directory. In ubuntu this is impossible if there is only one user other than root, because  $HOME is being used by the user and root has no password, so we create a temporary user to complete the encryption.
[NOTE]If your root account has a password or you have another account skip this step

Add him to the sudo group

Then relogin as tmp , check that your user’s directory is not being used and continue.

 

In the promt “Enter your login passphrase [ubuntu]:” add your user’s password.Wait for a while until the migration is completed and login as your user to complete the migration.

If you see your files then the migration is complete, else if you see “Access-Your-Private-Data.desktop  README.txt” mount the ecrypted $HOME with:

****RELOGIN**** as your user and delete the temporary folder of your $HOME and the tmp user:

Comment:

This site uses Akismet to reduce spam. Learn how your comment data is processed.