13 C
Texas
Melhttp://www.osradar.com
Guru Unix /Linux and GNU supporter

How to Encrypt Home Folder in Linux

If you’re on Linux, you already have the idea of the security level of this awesome operating system. This has set up all the systems in such a manner that until you give the permission, there’s hardly any malware to run into your system. However, despite the security, your data isn’t completely secured. Those who have physical access to your system can easily extract your sensitive data.

For solving this issue, you can set up encryption for your “home” folder. This way, no one can extract sensitive information out of your system and even if they do so, it’ll be nothing more than garbage & unreadable data. Let’s get started with encrypting your “home” folder on your Linux distro.

Note that I’m using Linux Mint. But the system procedure is the same for all the other Linux distros. We’ll be using a tool named “EcryptFS”.

Downloading & Installing the tool

According to your Linux distro, install the tool first.

  • Ubuntu + Ubuntu-based

- Advertisement -

If you’re running Ubuntu or Ubuntu-based distro, run this command:

sudo apt install ecryptfs-utils

  • Debian

Run this command:

sudo apt-get install ecryptfs-utils
  • Fedora

For Fedora users, this is the required command line:

sudo dnf install ecryptfs-utils
  • OpenSUSE

sudo zypper install ecryptfs-utils
  • Arch Linux

sudo pacman -S ecryptfs-utils

If your Linux distro or distro-base isn’t listed here, then you have to build it from source. You can also check out the official EcryptFS download page. For any issue with the building, you may need to take help from EcrypFS documentation.

Encrypting the “home” folder

During the encryption process, we have to make a temporary user for performing the encryption tasks. After completing the process, we’ll delete it. This second user is needed as you can’t directly encrypt your “home” folder while logged into the account.

  • Add a user account with the name “encrypt-admin”.

  • Now, it’s time to start encrypting. Run this command:
sudo ecryptfs-migrate-home –u <username>
  • Note that if you want to encrypt multiple accounts, you have to run this process multiple times.

Now, exit the temporary account and login to your main account.

Adding encryption password

After logging in to your original account, run this command:

ecryptfs-add-passphrase

This will give you the option of entering a password for the encrypted “home” folder.

For fully enjoying the feature, restart your Linux system.

Recently, Ubuntu has released their latest edition – v18.04 LTS. Check out every new feature of Ubuntu 18.04 LTS.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article