首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更改ecryptfs目录的密码

更改ecryptfs目录的密码
EN

Ask Ubuntu用户
提问于 2013-07-13 10:23:48
回答 1查看 14.4K关注 0票数 9

我想要一个加密的目录(不是homedir!)比方说/testdata。

我使用了以下命令和参数对其进行加密:

代码语言:javascript
复制
root@pc:~# mount -t ecryptfs /testdata/ /testdata/
Passphrase: 
Select cipher: 
 1) aes: blocksize = 16; min keysize = 16; max keysize = 32
 2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56
 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24
 4) twofish: blocksize = 16; min keysize = 16; max keysize = 32
 5) cast6: blocksize = 16; min keysize = 16; max keysize = 32
 6) cast5: blocksize = 8; min keysize = 5; max keysize = 16
Selection [aes]: 
Select key bytes: 
 1) 16
 2) 32
 3) 24
Selection [16]: 
Enable plaintext passthrough (y/n) [n]: 
Enable filename encryption (y/n) [n]: y
Filename Encryption Key (FNEK) Signature [b9fc92f854a4c85b]: 
Attempting to mount with the following options:
  ecryptfs_unlink_sigs
  ecryptfs_fnek_sig=b9fc92f854a4c85b
  ecryptfs_key_bytes=16
  ecryptfs_cipher=aes
  ecryptfs_sig=b9fc92f854a4c85b
WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt],
it looks like you have never mounted with this key 
before. This could mean that you have typed your 
passphrase wrong.

Would you like to proceed with the mount (yes/no)? : yes
Would you like to append sig [b9fc92f854a4c85b] to
[/root/.ecryptfs/sig-cache.txt] 
in order to avoid this warning in the future (yes/no)? : yes
Successfully appended new sig to user sig cache file
Mounted eCryptfs

此命令创建以下文件:

代码语言:javascript
复制
root@pc:~# cat .ecryptfs/sig-cache.txt 
b9fc92f854a4c85b

现在我想改变我以前用过的密码。我找到了ecryptfs-rewrap-passphrase命令,但我不确定我是否在正确的路径上:

代码语言:javascript
复制
root@pc:~# ecryptfs-rewrap-passphrase .ecryptfs/sig-cache.txt 
Old wrapping passphrase: 
New wrapping passphrase: 
New wrapping passphrase (again): 
Error: Unwrapping passphrase failed [-5]
Info: Check the system log for more information from libecryptfs

/var/log/syslog说:

代码语言:javascript
复制
Jul 13 13:16:19 pc ecryptfs-rewrap-passphrase: ecryptfs_unwrap_passphrase: PK11_CipherOp() error; SECFailure = [-1]; PORT_GetError() = [-8188]

我对氪星有个新手身份,我希望能在这里得到一些启示。

EN

回答 1

Ask Ubuntu用户

发布于 2015-01-02 21:06:02

没有办法动态地更改密码,因为氪码单独地用密码对每个文件进行加密,所有的文件都需要用新的密码来重写。

所以,您所能做的就是创建一个新目录,用新密码挂载它,并复制那里的所有文件。

这方面的例外是当您使用Ubuntu创建一个安装/home/ on。当以这种方式设置Ubuntu时,它不是直接使用您的密码进行文件加密,而是生成一个随机的密码,保存到~/.ecryptfs/wrapped-passphrase中。然后用您的个人密码加密该文件。因此,您的个人相位差可能会改变,文件加密密码将保持不变。手动挂载时可能会重新创建这种行为,但默认情况下并非如此,您的个人密码被直接用于文件加密。

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

https://askubuntu.com/questions/319561

复制
相关文章

相似问题

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