How to install EncFS on Ubuntu 17.04

To install EncFS on Ubuntu 17.04

EncFS is a free cryptographic filesystem similar to eCryptfs. It transparently encrypts files, using an arbitrary directory as storage for the encrypted files. It is built based on FUSE to mount an encrypted directory onto another directory specified by the user. Installing EncFS on Ubuntu is very easy and this article shows the method to install EncFS on Ubuntu.

Installing EncFS

Make sure that the necessary repositories are added to your system before you install EncFS.

root@linuxhelp1:~# add-apt-repository ppa:eugenesan/ppa
 This repository contains collection of customized, updated, ported and backported
packages for two last LTS releases and latest pre-LTS release.
Packages for older releases relocated to ppa:eugenesan/archive or deleted.

+-------------------------------------------------------------------------------------+
| Disclaimer:
+-------------------------------------------------------------------------------------+
* Packages in this a nd related PPAs are for personal use only.
  They developed specifically for several custom environments and may not work for you.
* Usage of packages in this PPA, in some forms, might contradict licenses of software
  packaged in this and related PPAs. End users and administrator are responsible for
  runtime licensing and possible legal consequences.
* Some packages provided with their dependencies while some might require additional
  Ubuntu repositories and external PPAs. Below is the list of
.
.
.
gpg: keybox ' /tmp/tmpep5uscs5/pubring.gpg'  created
gpg: /tmp/tmpep5uscs5/trustdb.gpg: trustdb created
gpg: key E61380B28313A596: public key " Launchpad synergy+"  imported
gpg: Total number processed: 1
gpg:               imported: 1
OK


Once it is done, update the repo as follows.

root@linuxhelp1:~# apt-get update
Get:1 http://security.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]                                     
Get:2 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty InRelease [15.4 kB]                                  
Hit:3 http://in.archive.ubuntu.com/ubuntu zesty InRelease                                                                  
Get:4 http://in.archive.ubuntu.com/ubuntu zesty-updates InRelease [89.2 kB]                               
Get:5 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main i386 Packages [1,108 B]     
Get:6 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main amd64 Packages [1,100 B]                           
Get:7 http://ppa.launchpad.net/eugenesan/ppa/ubuntu zesty/main Translation-en [1,288 B]          
Hit:8 http://in.archive.ubuntu.com/ubuntu zesty-backports InRelease                                    
Fetched 197 kB in 3s (61.9 kB/s)
Reading package lists... Done

All is set for the installation of EncFS, use the following command for the same purpose.

root@linuxhelp1:~# apt-get install  encfs -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libtinyxml2-4
The following NEW packages will be installed:
  encfs libtinyxml2-4
0 upgraded, 2 newly installed, 0 to remove and 53 not upgraded.
Need to get 384 kB of archives.
After this operation, 1,736 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu zesty/universe amd64 libtinyxml2-4 amd64 4.0.1-1 [25.8 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu zesty/universe amd64 encfs amd64 1.9.1-4 [358 kB]
Fetched 384 kB in 6s (61.1 kB/s)                                                                                                   
Preconfiguring packages ...
Selecting previously unselected package libtinyxml2-4:amd64.
(Reading database ... 168833 files and directories currently installed.)
Preparing to unpack .../libtinyxml2-4_4.0.1-1_amd64.deb ...
Unpacking libtinyxml2-4:amd64 (4.0.1-1) ...
Selecting previously unselected package encfs.
Preparing to unpack .../encfs_1.9.1-4_amd64.deb ...
Unpacking encfs (1.9.1-4) ...
Setting up libtinyxml2-4:amd64 (4.0.1-1) ...
Processing triggers for libc-bin (2.24-9ubuntu2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up encfs (1.9.1-4) ...
Processing triggers for libc-bin (2.24-9ubuntu2) ...


EncFS has been installed, you can get to know more about the application by running the following command.

root@linuxhelp1:~# encfs 
Build: encfs version 1.9.1

Usage: encfs [options] rootDir mountPoint [-- [FUSE Mount Options]]

Common Options:
  -H                   show optional FUSE Mount Options
  -s                   disable multithreaded operation
  -f                   run in foreground (don' t spawn daemon).
                       Error messages will be sent to stderr
                       instead of syslog.
  -v, --verbose        verbose: output encfs debug messages
  -i, --idle=MINUTES   Auto unmount after period of inactivity
  --anykey             Do not verify correct key is being used
  --forcedecode        decode data even if an error is detected
            (for filesystems using MAC block headers)
  --public        act as a typical multi-user filesystem
            (encfs must be run as root)
  --reverse        reverse encryption
  --extpass=program    Use external program for password prompt

Example, to mount at ~/crypt with raw storage in ~/.crypt :
    encfs ~/.crypt ~/crypt

For more information, see the man page encfs(1)


You can also remove the EncFS package from your system with the following command.

root@linuxhelp1:~# apt-get remove encfs -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libtinyxml2-4
Use ' apt autoremove'  to remove it.
The following packages will be REMOVED:
  encfs
0 upgraded, 0 newly installed, 1 to remove and 53 not upgraded.
After this operation, 1,631 kB disk space will be freed.
(Reading database ... 168912 files and directories currently installed.)
Removing encfs (1.9.1-4) ...
Processing triggers for libc-bin (2.24-9ubuntu2) ...
Processing triggers for man-db (2.7.6.1-2) ...

Don' t you agree it was an easy installation process? EncFS is very useful as it creates a virtual encrypted filesystem which stores encrypted data in the rootdir directory and makes the unencrypted data visible at the mountPoint directory.

Tag : Ubuntu
FAQ
Q
How to get the entire information and option to be available for encFS?
A
for getting the entire information and option to be available for encFS, use the following command as given below "encfs --help" (or) "man encfs"
Q
What is a use of "--extpass=program" option in encFS?
A
Specify an external program to use for getting the user password. When the external program is spawned, the environment variable "RootDir" will be set to contain the path to the root directory. The program should print the password to standard output.

EncFS takes everything returned from the program to be the password, except for a trailing newline (\n) which will be removed.

For example, specifying --extpass=/usr/lib/ssh/ssh-askpass will cause EncFS to use ssh's password prompt program.
Q
How to install EncFS on Debain?
A
For the installation of EncFS on Debian, use the following command as given below "apt-get -y install encfs"
Q
What is the Formal syntax for the EncFS?
A
The formal sysntax for the "EncFS" as given below "encfs [options] rootDir mountPoint [-- [FUSE Mount Options]]"
Q
How to use the "--reverse" option in encFS command?
A
The example of using the "--reverse" option with "encFS" command as given below "encfs --reverse /home/me /tmp/crypt-view"