How to password protect a folder or directory on Linux

Last updated on December 16, 2020 by Dan Nanni

Suppose you have a folder in your Linux home directory, where you store secure document files which you do not want anyone to access without a password. That way, even if someone manages to get a hold of your computer and access your home directory, there is still another line of defense for your private files.

Cryptkeeper is a Linux system tray applet that manages encrypted folders. Underneath it, EncFS, a FUSE-based encrypted file system, handles transparent encryption and decryption.

In this tutorial, I will describe how to password protect a folder on Linux by using Cryptkeeper.

Install Cryptkeeper in Fedora

You can install Cryptkeeper from Fedora's base repository:

$ sudo yum install cryptkeeper

After installation, go to ApplicationsSystem ToolsCryptkeeper to launch Cryptkeeper.

Install Cryptkeeper in Debian, Ubuntu or Linux Mint

To install Cryptkeeper on Debian-based Linux, use apt-get command.
$ sudo apt-get install cryptkeeper

Note that Cryptkeeper is no longer available in Ubuntu base repository on Ubuntu 18.04 or later. On newer Ubuntu systems, use EncFS directly to password protect a directory.

On Ubuntu, you can launch Cryptkeeper via Unity Dash. On Debian or Linux Mint, go to ApplicationsSystem ToolsCryptkeeper to launch Cryptkeeper.

NOTE: If Cryptkeeper indicator does not show up in the Unity's top panel notification area, it may be due to the systray's new whitelist elimination policy. To fix this problem, first obtain systray-whitelist value, and append Cryptkeeper to the existing whitelist, as follows.

First, browse the current whitelist:

$ gsettings get com.canonical.Unity.Panel systray-whitelist
['JavaEmbeddedFrame', 'Wine', 'Update-notifier']

Add Cryptkeeper to the whitelist:

$ gsettings set com.canonical.Unity.Panel systray-whitelist "['JavaEmbeddedFrame', 'Wine', 'Update-notifier', 'Cryptkeeper']"

Encrypt a Folder with Cryptkeeper

Once activated, Cryptkeeper indicator will show up in the desktop panel on the top right corner. Click on the indicator, and choose New encrypted folder to create a new encrypted folder.

Choose the name of a folder to password protect, and its location.

Enter a password for your new encrypted folder. Once you click on Forward button, it will create a new encrypted folder.

To access an encrypted folder, you need to open it first. To open an existing encrypted folder, click on Cryptkeeper indicator, and click on the folder name. You will be prompted to enter a password. Once the folder is open, you can freely access content in it. To password protect the folder again, simply close the folder by clicking on the folder name in Cryptkeeper indicator.

Auto-Start Cryptkeeper on Your Desktop

If you want to set up Cryptkeeper indicator to launch automatically on your desktop, do the following.

On Fedora:

Choose Session and Startup menu under Settings.

Add Cryptkeeper under Application Autostart tab.

On Ubuntu:

Launch Startup Applications menu via Dash, and add Cryptkeeper as a startup program.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal (Credit Card) or Bitcoin (1M161JGAkz3oaHNvTiPFjNYkeABox8rb4g).

Please note that this article is published by under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean