Encrypted Dropbox w/ EncFS

Posted by zbrom on June 25, 2021 · 1 min read

This tutorial will allow you to make an encrypted EncFS filesystem within your Dropbox account, or other file sharing service. Please close Dropbox or disconnect your internet prior to following this tutorial.

Make sure you have a bin folder in your home directory; feel free to set an Environment Variable for it if desired:

mkdir ~/bin

Install encfs from the official repository:

pacman -S encfs

Change the directory to just outside the folder you wish to setup the EncFS filesystem:

cd ~/

Run the encfs command to create the encrypted and decrypted filesystem. You must use full paths. ghorr recommends using the highest AES algorithm and the highest block size:

encfs /home/ghorr/Dropbox/.encrypted /home/ghorr/Dropbox-decrypted

Change directory into your encrypted encfs filesystem:

cd ~/Dropbox/.encrypted

Move the .encfs6.xml into a different location, so it will not get uploaded to Dropbox:

mkdir ~/bin/dropbox && mv .encfs6.xml ~/bin/dropbox

Create a new file in ~/bin/dropbox to store your EncFS password to automatically unlock the filesystem:

nano ~/bin/dropbox/encfs-dropbox.pass

Enter your password into the file and save it.

Create the following script in your home bin folder:

nano encfs-dropboxmount

Add the following, using full paths for everything:


export ENCFS6_CONFIG="/home/ghorr/bin/dropbox/.encfs6.xml" encfs "/home/ghorr/Dropbox/.encrypted/" /home/ghorr/Dropbox-decrypted/

encfs --public --extpass="cat /home/ghorr/bin/dropbox/encfs-dropbox.pass" $*

To automount the encrypted filesystem on boot, edit your fstab:

nano /etc/fstab

Add the following line to your fstab file:

/home/ghorr/bin/dropbox/encfs-dropboxmount#/home/ghorr/Dropbox/.encrypted /home/ghorr/Dropbox-decrypted/ fuse rw,user,auto 0 0

The encrypted filesystem should now start on boot.