问题: 我今天早些时候更改了密码,但我一定是输入错误了,因为之后我无法登录。我启动到 Grub 菜单并启动无密码 root shell 来重置我的密码。这是成功的,因为我现在可以输入新密码并通过登录屏幕。但是,一旦我这样做,我就会收到一条错误消息:
Your session only lasted less than 10 seconds. If you have not logged out yourself, this could mean there is some installation problem, or that you may be out of diskspace. Try logging in with one of the failsafe sessions to see if you can fix this problem.
syndaemon: no process found
/etc/mdm/Xsession: Beginning session setup...
localuser:[username] being added to access control list
Can't create dir /home/[username]/Desktop
Can't create dir /home/[username]/Downloads
Can't create dir /home/[username]/Templates
Can't create dir /home/[username]/Public
Can't create dir /home/[username]/Documents
Can't create dir /home/[username]/Music
Can't create dir /home/[username]/Pictures
Can't create dir /home/[username]/Videos
Script for none started at run_im
Script for auto started at run_im
Script for default started at run_im
init: session.migration main process (2322)terminated with status 1
init: logrotate main process (2304) killed by TERM signal
init: Disconnected from notified D-Bus bus
我可以选择点击“确定”,这将带我返回登录屏幕。如果我尝试再次登录,我会收到完全相同的消息。
注意:上面的文本中显示[用户名],实际错误显示了我的实际用户名。然而,当涉及到我的在线身份时,我很偏执,因此我在上面打印的错误中对其进行了审查。
我努力了:
还;我刚刚尝试使用命令行访问我的加密文件,但失败了
mint@mint ~ $ ecryptfs-mount-private
ERROR: Encrypted private directory is not setup properly
还还
mint@mint ~ $ ecryptfs-unwrap-passphrase /media/34e5c4fa-0621-46cb-83b0-763c2a0dc49c/home/.private/[username]/.ecryptfs/wrapped-passphrase
Passphrase:
Error: Unwrapping passphrase failed [-2]
Info: Check the system log for more information from libecryptfs
它与磁盘空间无关(我正在尝试进入底部最大的驱动器):
mint@mint ~ $ df
df: ‘/root/.gvfs’: Permission denied
Filesystem 1K-blocks Used Available Use% Mounted on
/cow 2032928 1676256 250076 88% /
udev 1979616 4 1979612 1% /dev
tmpfs 404796 1552 403244 1% /run
/dev/sdb1 3908100 3876388 31712 100% /cdrom
/dev/loop0 1523456 1523456 0 100% /rofs
none 4 0 4 0% /sys/fs/cgroup
tmpfs 2023964 16 2023948 1% /tmp
none 5120 0 5120 0% /run/lock
none 2023964 84 2023880 1% /run/shm
none 102400 28 102372 1% /run/user
/dev/mapper/mint--vg-root 956884652 103557812 804696876 12% /media/mint/34e5c4fa-0621-46cb-83b0-763c2a0dc49c
还尝试了以下方法。它安装文件,但不解密
mint@mint ~ $ sudo ecryptfs-recover-private
INFO: Searching for encrypted private directories (this might take a while)...
INFO: Found [/media/mint/34e5c4fa-0621-46cb-83b0-763c2a0dc49c/home/.ecryptfs/tijmen/.Private].
Try to recover this directory? [Y/n]: y
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] y
INFO: Enter your LOGIN passphrase...
Passphrase:
Error: Unwrapping passphrase and inserting into the user session keyring failed [-5]
Info: Check the system log for more information from libecryptfs
mint@mint ~ $ sudo ecryptfs-recover-private
INFO: Searching for encrypted private directories (this might take a while)...
INFO: Found [/media/mint/34e5c4fa-0621-46cb-83b0-763c2a0dc49c/home/.ecryptfs/tijmen/.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 at [/tmp/ecryptfs.cQtlJNMc].
mint@mint ~ $
其他相关信息 我在 1TB 外部 HDD 上运行 Linux Mint 17.2,因为我的内部 HD 几个月前就坏了。到目前为止,这就像一个魅力。我现在使用实时 USB 驱动器,因为我希望能够检索一些重要文件(例如我的 KeePass 数据库文件),但外部 HDD 上的安装是通过在安装过程中使用“加密分区”选项进行加密的。
我已经使用 Linux Mint 大约 6-8 个月了,所以我对日常使用终端的使用有些熟练,但我对 Linux 的底层工作原理和 root 命令选项完全一无所知我的处置。
这是我在 live USB 上使用的 Linux 发行版,与我在外部 HDD 上安装的发行版相同
mint@mint ~ $ cat /etc/*-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17.2
DISTRIB_CODENAME=rafaela
DISTRIB_DESCRIPTION="Linux Mint 17.2 Rafaela"
NAME="Ubuntu"
VERSION="14.04.2 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.2 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
cat: /etc/upstream-release: Is a directory
这是内核 Linux 3.16.0-38-generic x86_64
我可以使用实时 USB 查看我的所有文件夹和文件,但由于它们是加密的,所以我实际上无法访问它们。
----第一次回答后更新---- GAD3R建议我
Boot using Linux-mint LiveCD
Make sure that your target system's hard drive is mounted
Open a terminal
Install ecryptfs-utils documentation
sudo apt-get install -y ecryptfs-utils
And run
sudo ecryptfs-recover-private
Follow the prompts
不幸的是,这不起作用。
mint@mint ~ $ sudo apt-get install -y ecryptfs-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
ecryptfs-utils is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 326 not upgraded.
mint@mint ~ $ sudo ecryptfs-recover-private
INFO: Searching for encrypted private directories (this might take a while)...
INFO: Found [/media/mint/34e5c4fa-0621-46cb-83b0-763c2a0dc49c/home/.ecryptfs/tijmen/.Private].
Try to recover this directory? [Y/n]: y
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] y
INFO: Enter your LOGIN passphrase...
Passphrase:
Error: Unwrapping passphrase and inserting into the user session keyring failed [-5]
Info: Check the system log for more information from libecryptfs
mint@mint ~ $
答案1
使用 Linux-mint LiveCD 启动
确保目标系统的硬盘已安装
打开终端
安装 ecryptfs-utils文档
sudo apt-get install -y ecryptfs-utils
并运行
sudo ecryptfs-recover-private
按照提示操作
访问您解密的数据并将其保存在其他地方
您还可以启动图形文件浏览器sudo nautilus
并导航到临时目录
答案2
我在早期的 Ubuntu 版本下加密了我的 /home 分区。然后,我在重新安装时升级到 LM17,而没有触及 /home。 /home 分区被保留,我可以在 LM17 下打开它。然后我遇到了一个尚未确定的系统问题,导致登录后无法启动 cinnamon 桌面,因此一切都必须在命令行模式下完成。
但我设法使用以下命令解锁 /home 分区:
$cd /home/yourname
转到主文件夹。然后,
$sudo ecryptfs-recover-private
并输入我的登录密码。请注意,/home 中有一个 README.txt 文件,但推荐的命令对我不起作用。上面的命令将 /home 文件解密到包含普通纯模式文件的 /tmp/ 中。此时,我安装了 USB 并开始使用 rsync 进行复制。
$mount /dev/s<xxx> /media/usb #you can call the latter anything you want almost
$cd /tmp<somename>
$rsync -aruvP <homefiles> /media/usb
请注意,一旦重新启动,/tmp 文件夹就会消失(由于之前备份到 /media/usb 时出现 I/O 错误,我不得不这样做)。