How to Encrypt Home Folder in Ubuntu After Installation

How to Encrypt Home Folder in Ubuntu After Installation

Ubuntu offers to do encryption in your home directory during the installation process. But if you don’t do encryption during the installation process and change your mind to do encryption then.

You don’t need to re-install to do encryption in the home directory. You can do encryption without the need to re-install by following the following method.

Ubuntu uses using eCryptfs to do encryption. eCryptfs will do encryption by using password from user you. When doing log in on Ubuntu systems, your home directory will be automaticallydecrypt by using password owned by user so you can open the directory inencryption the.

Before starting the process encryption this, you have to be careful, make sure you do backup important files or data in the home directory user you. In this process, a backup from the home directory on the computer automatically, but you should still have backup important additional files that you create yourself.

To be able to do encryption home directory, make sure your Ubuntu has 2.5 times more space left than the file size in the home directory that you want to encrypt.

Open Terminal on your Ubuntu by pressing the keyboard combination CTRL + ALT + T or open Terminal via the application menu.

Then install the eCryptfs package you need to do encryption by using the following command in Terminal, you need to be connected to the internet to install it:

sudo apt-get install ecryptfs-utils cryptsetup

To do encryption on the home directory of a users, you have to do it when you’re not log in from user the. That means you need user another account with Administrator type or has access rights to perform the “sudo” command.

You can make a user new from system settings, then select User Accounts. Make a user new with Administrator type or privileges. Don’t forget to give password on user so that it can be used.

Encrypting the User’s Home Directory in Ubuntu

After successfully making a user new with Administrator privileges. Exit or log out from the current user log in and then log in by using user the new one you just created for the time being.

To do encryption your home directory, enter the following command in Terminal. Replace the word “username” in the command with username from the account you want to encrypt the directory home-his:

sudo ecryptfs-migrate-home -u namauser

Your home directory will be inencryption and you will see some important warning notes. Read carefully the warnings.

Then log out from user meanwhile and log in back using user your original before. do not do it reboot until the process is complete!

After you successfully log back in with user previously, an “update information” window will appear, then click knob “Run this action now” on the window to create a passphrase or password recovery. Record and save passphrase it’s in a safe place, don’t lose it, you’ll need it if you have to recovery your files manually later.

If in your case the “update information” window does not appear at the time of logging in so it does not display passphraseyou can run the command “ecryptfs-unwrap-passphrase” in Terminal to view passphrase the. You can run the command later if you want to see passphrase again.

Encrypting Swap Partition

When doing encryption home directory during the Ubuntu installation process, partition swap yours will also be encrypted.

Likewise in this way. After successfully doing encryption in your home directory, then you also have to do encryption swap partition. To do this, enter the following command in Terminal:

sudo ecryptfs-setup-swap

On Linux, one of the functions of the swap partition is to perform hibernate. By doing encryption on the swap partition, you can’t use the feature hibernate on your Ubuntu.

Delete Backup Files and Temporary Accounts

After the process is complete, restart your Ubuntu. Do restart up several times to make sure that everything goes well.

If you can make sure that everything goes well, you can delete the file backup from the previously auto-generated home directory. You can also delete the account user that you made before.

You can delete files backup from the home directory directly from the file explorer by accessing it using “sudo” permissions, or you can delete it via Terminal by using the following command:

sudo rm -rf /home/user.random

Be careful when you use this command, a slight mistake can delete your original home directory or you can delete other important files or data from the system if you enter the wrong command.

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *