我想用密码锁定任何目录,是否可以为任何目录或文件设置密码或密码,而无需使用第三方工具,如cryptkeeper。
发布于 2017-08-23 11:09:58
您可以使用ccrypt加密文件,如下所示:
# prompts for the password, encrypts the file and adds “.cpt”
ccrypt /path/to/file
# prompts for the password, recursively (`-r`) encrypts every file
# in the directory and its subdirectories and adds “.cpt” to every file
ccrypt -r /path/to/dir
# prompts for the password, decrypts (`-d`) the file and removes the “.cpt” ending
ccrypt -d /path/to/file要将整个目录加密为一个加密文件,首先需要打包,例如使用tar:
tar cf - /path/to/dir | ccrypt > /path/to/file.tar.cpt # without compression
tar czf - /path/to/dir | ccrypt > /path/to/file.tgz.cpt # with compression有关更多信息,请参见命令页!
为了简化这一点,您可以使用这些命令编写一个脚本,并将其添加到文件管理器以获得例如。下拉菜单中的“加密”和“解密”选项。
当然,实现您想要的东西还有其他方法,这里有一些链接:
https://askubuntu.com/questions/948980
复制相似问题