
To encrypt the directory ostechnix with ecryptfs filesystem, run the following command as sudo or root user: $ sudo mount -t ecryptfs ~/ostechnix/ ~/ostechnix/ Once the directory is encrypted, move the backup to the encrypted directory. So if the directory contains any data, move them to a different location, and then encrypt it.

If you do, the existing data will still remain unencrypted, or the data can't be accessed. Please note that you shouldn't encrypt a non-empty directory. On openSUSE: $ sudo zypper -install ecryptfs-utils Encrypt Directories With eCryptfs In Linuxįor the purpose of this guide, I am going to encrypt a directory named "ostechnix".

On Fedora: $ sudo dnf install ecryptfs-utils On Debian, Ubuntu, Linux Mint: $ sudo apt-get install ecryptfs-utils To install eCryptfs on Arch Linux and its variants like EndeavourOS and Manjaro Linux, run: $ sudo pacman -S ecryptfs-utils Install eCryptfs on LinuxĮCryptfs has been packaged for many Linux operating systems and is available in the default repositories. Now, it has been maintained by Dustin Kirkland and Tyler Hicks of Canonical, the parent company of Ubuntu. eCryptfs has been included in Linux Kernel since version 2.6.19.ĮCryptfs is derived from Erez Zadok's Cryptfs, and the FiST framework for stacked filesystems.ĮCryptfs is originally authored by Michael Halcrow and IBM Linux Technology Center.

It stores the cryptographic metadata in the headers of files, so the encrypted data can be easily moved between different users and even systems. No separate partition or pre-allocated space is actually required! eCryptfs should work well on local filesystems such as EXT3, EXT4, XFS, JFS and ReiserFS etc.ĮCryptfs also supports networked filesystems such as NFS, CIFS, Samba and WebDAV, but not fully functional as it works on local filesystems.

Using eCryptfs, we can easily create an encrypted directory to store the confidential data and mount it on any directory. But eCryptfs is a stacked filesystem that can be mounted on any directory and on top of the main file system. In full disk encryption mechanism, the entire partition or disk, in which the filesystem resides, is encrypted.
