Encrypting a directory on Linux

To encrypt a directory on Linux you can use encfs. You'll need two directories: a mount point, and a raw storage directory.

mkdir ~/mount-point
mkdir ~/.encfs-raw

Then we'll need to setup encfs for these directories. The default options should be plenty secure for whatever you'll need.

encfs ~/mount-point ~/.encfs-raw

To unmount this encrypted directory use fusermount

fusermount -u ~/mount-point

To change the password on your encfs directory use encfsctl

encfsctl passwd ~/mount-point

Update: You can use the --idle command to automatically unmount the directory after X minutes of inactivity

Leave A Reply
All content licensed under the Creative Commons License