ecryptfs-recover-private 创建无法读取的加密文件夹

ecryptfs-recover-private 创建无法读取的加密文件夹

经过数月的正常运行后,系统ecryptfs已损坏并/home/无法访问。运行时(通过访客帐户和 Live-CD):

root@ubuntu:/media/backup/home/me# ecryptfs-mount-private
ERROR: Encrypted private directory is not setup properly`

然后我尝试:

root@ubuntu:/media/backup/home/me# ecryptfs-recover-private
INFO: Searching for encrypted private directories (this might take a while)...
INFO: Found [/media/backup/home/.ecryptfs/me/.Private].
Try to recover this directory? [Y/n]: Y
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] n
INFO: To recover this directory, you MUST have your original MOUNT passphrase.
INFO: When you first setup your encrypted private directory, you were told to record
INFO: your MOUNT passphrase.
INFO: It should be 32 characters long, consisting of [0-9] and [a-f].

Enter your MOUNT passphrase: 
INFO: Success!  Private data mounted read-only at [/tmp/ecryptfs.uDWfDMCO].
root@ubuntu:/media/backup/home/me# ls /tmp/ecryptfs.uDWfDMCO/ECRYPTFS_FNEK_ENCRYPTED.F
Display all 124 possibilities? (y or n)'

这创建了 124 个加密文件夹,其中似乎保存着我的/home/数据。我只是不知道如何访问这些数据。此外,查看时发现/var/log/syslog/有很多以下错误:

Dec  3 11:19:22 ubuntu kernel: [ 1627.918209] 
ecryptfs_parse_tag_70_packet: Error attempting to find auth tok for fnek sig [1b62c525049b45e0]; rc = [-2]
Dec  3 11:19:22 ubuntu kernel: [ 1627.918214] 
ecryptfs_decode_and_decrypt_filename: Could not parse tag 70 packet from filename; copying through filename as-is`

我真的很希望能ecryptfs再次正常工作或至少恢复我的数据。

答案1

每当我尝试使用 MOUNT 密码时,也会收到这些错误(我的加密主文件夹没有损坏):

[ 2977.052719] ecryptfs_parse_tag_70_packet: Error attempting to find auth tok for fnek sig [2e1f1a0ca6f5f8f3]; rc = [-2]
[ 2977.052721] ecryptfs_decode_and_decrypt_filename: Could not parse tag 70 packet from filename; copying through filename as-is
[ 2977.052726] Could not find key with description: [2e1f1a0ca6f5f8f3]
[ 2977.052728] process_request_key_err: No key

我成功地使用 LOGIN 密码挂载了我的旧主文件夹,这是您第一次创建 ecryptfs 主文件夹时使用的原始密码。

host:/mnt/mountpoint/home/.ecryptfs/user> ecryptfs-recover-private .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 [XXXXXXXXXXXXXXXXXX] into the user session keyring
INFO: Success!  Private data mounted read-only at [/tmp/ecryptfs.8dXogIbs].

答案2

我也遇到过同样的问题。通过 sudo passwd 更改了我的用户密码,这很正常;但第二天当我尝试登录时,却陷入了 gdm 登录循环。

然后使用 ctrl-alt-F1 进入虚拟终端,用我的新密码登录,看到主页是空的,做了一个

ecryptfs-recover-private

并输入我的旧密码。然后我的主页再次被安装,然后可以切换回图形界面 ctrl-F7 并使用新密码登录:)

然后就可以在终端上使用以下命令更新我的 cryptfs 密码:

ecryptfs-rewrap-passphrase /home/.ecryptfs/$USER/.ecryptfs/wrapped-passphrase

相关内容