How to encrypt a folder in Linux

This is simples tips the how to encrypt a folder in Linux (in 5 steps).

Test


  • OS: Linux Mint 19 Cinnamon
  • Kernel: 4.15.0-33-generic
  • Commands: apt, sudo, encfs, mkdir, fusermount
  • Interface: Shell




1st - Install the encfs application:

sudo apt install encfs

2nd -  Create 2 directories, one being to save your encrypted files and one to access your decrypted files.

cd ~
mkdir decrypted
mkdir encrypted

3st - Now execute the command:

encfs ~/encrypted ~/decrypted

The encfs will questions which options do you want to following:

 enter "x" for expert configuration mode,
 enter "p" for pre-configured paranoia mode,

Inform p and press enter.

After inform the password (the values is not displayed, attention the cap looks):

New Encfs Password: 

4th - The program works:
  • You save all files in the decrypted folder, the application will read this folder and will save in encrypted folder this files as the encrypted files.
  • Case you want block access the encrypted files, you use this command for unmount the folder decrypted.
fusermount  -u decrypted

If you open the decrypted folder you will see the files no existe more and the files in encrypted folder is encrypted

5th - Access you encrypted folder:
To access the encrypted folder execute the command:

encfs ~/encrypted ~/decrypted

Do you need some help? use the commands:

man encfs
encfs -h

Comentários

Postagens mais visitadas