在Debian 9 上如何使用EncFS加密目录

创建目录

创建包含解密和加密数据的目录:

$mkdir ~/decrypted-data
$mkdir ~/encrypted-data

挂载ENCFS目录

在此阶段,我们准备将EncFS加密目录~/encrypted data装载到~/decrypted data装载点:

$encfs ~/encrypted-data/      ~/decrypted-data/

在运行ENCFS时,我们将被问到:
创建新的加密卷。

Please choose from one of the following options:
enter "x" for expert configuration mode,
enter "p" for pre-configured paranoia mode,
anything else, or an empty line will select standard mode.
?> p
Paranoia configuration selected.

接下来,提供一个新密码,用于装载和解密数据。准备好后,您应该可以在“mount”命令输出中看到已装入的目录:

$mount | grep encfs
encfs on /home/onitroad/decrypted-data type fuse.encfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000,default_permissions)

使用ENCFS

存储在~/decrypted data目录中的任何数据都将作为加密数据存储在~/encrypted data目录中。
添加一些新数据,比如创建一个新文件FILE1

$echo onitroad.com > ~/decrypted-data/FILE1

检查两个目录中的数据:

$ls ~/decrypted-data/
FILE1
$ls ~/encrypted-data/
xCsHlozRb,TnR,jRW4TbdUuH

挂载和卸载

完成工作后,要拒绝访问解密数据,我们需要卸载(~/decrypted-data):

$fusermount -u ~/decrypted-data

要访问加密数据~/encrypted data目录,需要使用加密密码装入~/decrypted data目录:

$encfs ~/encrypted-data/~/decrypted-data/
EncFS Password:

安装ENCFS

# apt install encfs

如何更改ENCFS密码

$encfsctl passwd ~/encrypted-data/
Enter current Encfs password
EncFS Password: 
Enter new Encfs password
New Encfs Password: 
Verify Encfs Password: 
Volume Key successfully updated.
日期:2020-07-07 20:56:17 来源:oir作者:oir