首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >是否有任何方法为ubuntu中的目录和文件设置密码或密码?

是否有任何方法为ubuntu中的目录和文件设置密码或密码?
EN

Ask Ubuntu用户
提问于 2017-08-23 10:39:50
回答 1查看 537关注 0票数 1

我想用密码锁定任何目录,是否可以为任何目录或文件设置密码或密码,而无需使用第三方工具,如cryptkeeper。

EN

回答 1

Ask Ubuntu用户

发布于 2017-08-23 11:09:58

您可以使用ccrypt加密文件,如下所示:

代码语言:javascript
运行
复制
# 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

代码语言:javascript
运行
复制
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

有关更多信息,请参见命令页

为了简化这一点,您可以使用这些命令编写一个脚本,并将其添加到文件管理器以获得例如。下拉菜单中的“加密”和“解密”选项。

当然,实现您想要的东西还有其他方法,这里有一些链接:

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/948980

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档