Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed Ubuntu 12.04 a few weeks ago and am considering encrypting my home directory. Excuse the fuzzy thinking but, if the directory is encrypted and I am actively using various programs, is it un-encrypted?, partially un-encrypted, or unchanged and still encrypted?

I found this on another site. Will it work OK?

sudo apt-get install ecrypt-utils
sudo ecryptfs-migrate-home -u USERNAME

Thank you, Matthew

share|improve this question
    
I may be mistaken, but I think it is ecryptfs-utils not ecrypt-utils so the install line would be: 'sudo apt-get install ecryptfs-utils' –  Garrett Fogerlie Jan 24 '13 at 10:43
add comment

1 Answer

After you have encrypted you home directory using the ecryptfs-migrate-home command,

Your home directory is always encrypted, irrespective of what various programs you are actively using.

You can see the encrypted files in /home/.ecryptfs/matthew/.Private. What you see in /home/matthew directory is actually the decrypted version of files present in /home/.ecryptfs/matthew/.Private. Note that files present in /home/matthew are not saved anywhere, they are just decrypted on-the-fly.

For example, when you try to access /home/matthew/myfile.txt, ecryptfs will look for the encrypted version of this file in /home/.ecryptfs/matthew/.Private, decrypt it and display the decrypted version as /home/matthew/myfile.txt.

Similarly, when you write to the file /home/matthew/myfile.txt, ecryptfs will encrypt the content and save it inside /home/.ecryptfs/matthew/.Private instead.

This is actually completely seamless and transparent to the user. You can access your home directory just like you used to before encryption.

Your files are inaccessible until you login (/home/matthew directory is (almost) empty (some files are present to make the encryption work).). However, do note that once you login, /home/matthew will be mounted to show the decrypted version of /home/.ecryptfs/matthew/.Private and any running programs will be able to access files available in your home directory.

I hope this clears your doubts.

P.S. Record and make a note of the key that ecryptfs provides after the setup procedure. In case anything bad happens (e.g., operating system crashes), without this key your files will be inaccessible.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.