ecryptfs-recover-private 的问题:mount(2) 失败

lnm*_*rer 15 encryption ecryptfs

我正在将我的操作系统和数据从同一台计算机中的一个驱动器移动到另一个驱动器。(我有一个不错的新 SSD。)我的旧主目录里面有一个加密的子目录,我想从我的新安装中访问加密目录。我正在尝试使用ecryptfs-recover-private. 但是,我遇到了以下错误。

$ sudo ecryptfs-recover-private /BLAH/.Private
INFO: Found [.Private/].
Try to recover this directory? [Y/n]: 
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] 
INFO: Enter your LOGIN passphrase...
Passphrase: 
Inserted auth tok with sig [BLAH] into the user session keyring
mount: mount(2) failed: No such file or directory
ERROR: Failed to mount private data at [/tmp/ecryptfs.NcWkVmQ5].
Run Code Online (Sandbox Code Playgroud)

如果我让ecryptfs-recover-private自己找到目录,或者如果我对登录密码说“不”但使用安装密码,我会遇到同样的问题。

想法?

(我意识到这个网站上有几个类似的问题,但似乎没有一个能完全涵盖我的情况。)

sol*_*iCe 8

所以这个简单的命令ecryptfs-recover-private,被证明是不可靠的。上面的方法都不适合我,试图从ecryptfs移动到LUKS容器。

什么起作用了,是ubuntu社区维基中描述的手动方法

详细:

# sudo -i
# ecryptfs-add-passphrase --fnek 
Inserted auth tok with sig [aaaaaaaaaaaaa] into the user session keyring 
Inserted auth tok with sig [bbbbbbbbbbbbb] into the user session keyring  
# mkdir -p /mnt/new_mount_point  
# mount -t ecryptfs /mnt/old_mount_point/home/username/.Private /mnt/new_mount_point
Run Code Online (Sandbox Code Playgroud)
  • 选择 3(使用密码短语密钥类型,并使用您恢复的密码短语 aka unwrapped-passphrase)
  • 选择 aes(使用 aes 密码)
  • 选择 16(使用 16 字节密钥)
  • 启用明文直通:n
  • 启用文件名加密:y

  • 这对我有用,但在文件名加密之后还有一个问题,它要求使用 FNEK 签名,默认为“ecryptfs-add-passphrase --fnek”输出中的第一个身份验证tok。我发现我不得不使用第二个。 (2认同)
  • 截至目前,该解决方案似乎还不完整。至少还有一个问题:“文件名加密密钥(FNEK)签名[XYZ]:”,我不知道这个签名是什么......@Martin的解决方案(https://askubuntu.com/a/679565/924202)为我做的。:-) (2认同)

小智 7

我不确定为什么会发生这种情况 - 在您尝试恢复的新设置上使用相同的登录密码时,可能是内核密钥环搞砸了。

也就是说,在尝试恢复文件系统之前将包装好的密码添加到内核密钥环中是可行的(确保sudo在下面的两个命令中都使用):

sudo ecryptfs-insert-wrapped-passphrase-into-keyring /BLAH/.ecryptfs/wrapped-passphrase
sudo ecryptfs-recover-private /BLAH/.Private
Run Code Online (Sandbox Code Playgroud)

  • ...但不幸的是,第二个命令(`sudo ecryptfs-recover-private /BLAH/.Private`)对我来说仍然失败。:( `mount: /tmp/ecryptfs.aLkDeiWo: mount(2) 系统调用失败:没有这样的文件或目录。错误:无法在 [/tmp/ecryptfs.aLkDeiWo] 安装私有数据。` (3认同)

小智 6

对我来说,这有效,正如ecryptfs-mount-private 无法初始化 ecryptfs 密钥中所讨论的:

sudo keyctl link @u @s
sudo ecryptfs-recover-private .Private
Run Code Online (Sandbox Code Playgroud)