Friday, March 10, 2017

Encrypting home directory in Ubuntu 16.04 after install

I will be traveling so I decided to encrypt my home directory just in case my laptop is lost or stolen.
  1. Log in as target user  
  2. Install required packages
    • sudo apt-get install ecryptfs-utils
  3. Create a temporary admin user
  4. Log out target user
  5. Log in as temporary admin user
  6. Encrypt target user home directory
    • sudo ecryptfs-migrate-home -u target_user
  7. Encrypt swap partition
    • sudo ecryptfs-setup-swap
  8. Log out temporary admin user
  9. Log in as target user
  10. Record encryption passphrase
    • ecryptfs-unwrap-passphrase
  11. Reboot then log in as target user. Check if everything is working.
  12. Clean up by removing the backup folder and temporary admin user.