Ubuntu offers to encrypt your home directory during installation. The encryption has some drawbacks – there’s a performance penalty and recovering your files is more difficult. If you change your mind later, you can remove the encryption without reinstalling Ubuntu.
The process of removing the encryption involves creating a backup copy of your home directory without encryption, deleting the existing home directory, removing the encryption utilities, and moving the unencrypted copy back into place.
Back Up Your Home Directory
Your home directory is available to you in unencrypted form while you’re logged in, so you can easily create an unencrypted backup copy.
To create the backup copy, launch a terminal while you’re logged in and run the following command, replacing user with your username:
sudo cp -rp /home/user /home/user.backup
(The -rp options here tell cp to copy the directory recursively – that is, copy everything inside it – and to preserve the file ownership and permission information.)
Open the /home/user.backup directory on your system and verify that the backup was created successfully. All your files should be there. It’s always a good idea to have an additional backup, too – just in case.
Switch User Accounts
You can’t remove the encryption while you’re logged in, so you’ll have to switch to a different user account first. The simplest way to do this is by creating another user account with administrator (sudo) privileges. To create another user account, click your name on the panel and select User Accounts.
Create a new user account with the Administrator account type.
Set a password for the user account. You won’t be able to log in as the other user account until you set a password.
Log out from the panel after creating the other user account.
Select your temporary user account on the login screen and log in.
Once you’re logged in as the other user account, fire up a terminal and run the following command to delete your current, encrypted home directory. Be sure you have a backup before deleting the home directory! And be careful when running sudo rm -rf commands – these can quickly delete important files if you’re not careful.
sudo rm -rf /home/user
(Remember to replace user with your username.)
Delete the .ecryptfs folder in your backup folder. The encryption utilities won’t uninstall until you delete this folder.:
sudo rm -rf /home/user.backup/.ecryptfs
Next, remove the encryption utilities from your system:
sudo apt-get remove ecryptfs-utils libecryptfs0
Finally, restore the unencrypted backup of your home directory to its original location:
sudo mv /home/user.backup /home/user
Your home directory is now unencrypted. You can log out (or restart your system) and log in normally. You may want to delete the temporary user account from the User Accounts window.
Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.
- Published 06/9/12