新安装 Ubuntu 15.04 后,即使未设置磁盘加密,启动也会要求输入密码

新安装 Ubuntu 15.04 后,即使未设置磁盘加密,启动也会要求输入密码

我在笔记本电脑上安装了一块全新的 SSD,并全新安装了 Ubuntu 15.04,没有使用任何系统加密(仅对主目录进行加密)。但是,启动时它仍然要求我输入密码(我只需按 Enter 即可跳过):

http://i.imgur.com/yhtfLRd.jpg

此外,在完成全新安装后,升级软件包也会多次要求我输入密码,这Enter也被绕过了。该程序是“systemd-tty-ask-password-agent”,因此问题似乎出在 systemd 上。

终端中相关信息:

Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none! 
update-initramfs: deferring update (trigger activated)

Broadcast message from root@username-XPS-13-9343 (Thu 2015-04-30 22:06:22 EDT):

Password entry required for 'Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none!' (PID 4027).
Please enter password with the systemd-tty-ask-password-agent tool!

运行升级的完整输出:

+username@username-XPS-13-9343:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  ca-certificates firefox gir1.2-gudev-1.0 libcurl3 libcurl3-gnutls
  libgudev-1.0-0 libnm-glib-vpn1 libnm-glib4 libnm-util2 liboxideqt-qmlplugin
  liboxideqtcore0 liboxideqtquick0 libpam-systemd libsystemd0 libudev1
  network-manager oxideqt-codecs systemd systemd-sysv tzdata udev
  usb-creator-common usb-creator-gtk wpasupplicant
24 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.9 MB/73.2 MB of archives.
After this operation, 2,989 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libudev1 amd64 219-7ubuntu4 [40.8 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main udev amd64 219-7ubuntu4 [929 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main systemd-sysv amd64 219-7ubuntu4 [14.0 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libpam-systemd amd64 219-7ubuntu4 [108 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libsystemd0 amd64 219-7ubuntu4 [73.8 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main systemd amd64 219-7ubuntu4 [3,531 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libcurl3-gnutls amd64 7.38.0-3ubuntu2.2 [172 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libcurl3 amd64 7.38.0-3ubuntu2.2 [180 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libgudev-1.0-0 amd64 1:219-7ubuntu4 [14.4 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libnm-util2 amd64 0.9.10.0-4ubuntu15.1 [134 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libnm-glib-vpn1 amd64 0.9.10.0-4ubuntu15.1 [14.4 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main libnm-glib4 amd64 0.9.10.0-4ubuntu15.1 [84.7 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main tzdata all 2015d-0ubuntu0.15.04 [178 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main ca-certificates all 20141019ubuntu0.15.04.1 [191 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main firefox amd64 37.0.2+build1-0ubuntu0.15.04.1 [40.1 MB]
Get:16 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main gir1.2-gudev-1.0 amd64 1:219-7ubuntu4 [5,564 B]
Get:17 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main wpasupplicant amd64 2.1-0ubuntu7.1 [768 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main network-manager amd64 0.9.10.0-4ubuntu15.1 [754 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main usb-creator-gtk amd64 0.2.67ubuntu0.1 [23.4 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main usb-creator-common amd64 0.2.67ubuntu0.1 [23.7 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu/ vivid-updates/main oxideqt-codecs amd64 1.6.5-0ubuntu0.15.04.1 [533 kB]
Fetched 47.9 MB in 1min 18s (613 kB/s)                                         
Preconfiguring packages ...
(Reading database ... 171469 files and directories currently installed.)
Preparing to unpack .../libudev1_219-7ubuntu4_amd64.deb ...
Unpacking libudev1:amd64 (219-7ubuntu4) over (219-7ubuntu3) ...
Setting up libudev1:amd64 (219-7ubuntu4) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
(Reading database ... 171469 files and directories currently installed.)
Preparing to unpack .../udev_219-7ubuntu4_amd64.deb ...
Unpacking udev (219-7ubuntu4) over (219-7ubuntu3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (219-7ubuntu3) ...
Setting up udev (219-7ubuntu4) ...
Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none! 
update-initramfs: deferring update (trigger activated)

Broadcast message from root@username-XPS-13-9343 (Thu 2015-04-30 22:06:22 EDT):

Password entry required for 'Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none!' (PID 4027).
Please enter password with the systemd-tty-ask-password-agent tool!

Processing triggers for initramfs-tools (0.103ubuntu15) ...
update-initramfs: Generating /boot/initrd.img-3.19.0-15-generic
(Reading database ... 171469 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_219-7ubuntu4_amd64.deb ...
Unpacking systemd-sysv (219-7ubuntu4) over (219-7ubuntu3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up systemd-sysv (219-7ubuntu4) ...
(Reading database ... 171469 files and directories currently installed.)
Preparing to unpack .../libpam-systemd_219-7ubuntu4_amd64.deb ...
Unpacking libpam-systemd:amd64 (219-7ubuntu4) over (219-7ubuntu3) ...
Preparing to unpack .../libsystemd0_219-7ubuntu4_amd64.deb ...
Unpacking libsystemd0:amd64 (219-7ubuntu4) over (219-7ubuntu3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up libsystemd0:amd64 (219-7ubuntu4) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
(Reading database ... 171469 files and directories currently installed.)
Preparing to unpack .../systemd_219-7ubuntu4_amd64.deb ...
Unpacking systemd (219-7ubuntu4) over (219-7ubuntu3) ...
Processing triggers for dbus (1.8.12-1ubuntu5) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up systemd (219-7ubuntu4) ...
Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none! 
(Reading database ... 171469 files and directories currently installed.)
Preparing to unpack .../libcurl3-gnutls_7.38.0-3ubuntu2.2_amd64.deb ...
Unpacking libcurl3-gnutls:amd64 (7.38.0-3ubuntu2.2) over (7.38.0-3ubuntu2) ...
Preparing to unpack .../libcurl3_7.38.0-3ubuntu2.2_amd64.deb ...
Unpacking libcurl3:amd64 (7.38.0-3ubuntu2.2) over (7.38.0-3ubuntu2) ...
Preparing to unpack .../libgudev-1.0-0_1%3a219-7ubuntu4_amd64.deb ...
Unpacking libgudev-1.0-0:amd64 (1:219-7ubuntu4) over (1:219-7ubuntu3) ...
Preparing to unpack .../libnm-util2_0.9.10.0-4ubuntu15.1_amd64.deb ...
Unpacking libnm-util2:amd64 (0.9.10.0-4ubuntu15.1) over (0.9.10.0-4ubuntu15) ...
Preparing to unpack .../libnm-glib-vpn1_0.9.10.0-4ubuntu15.1_amd64.deb ...
Unpacking libnm-glib-vpn1:amd64 (0.9.10.0-4ubuntu15.1) over (0.9.10.0-4ubuntu15) ...
Preparing to unpack .../libnm-glib4_0.9.10.0-4ubuntu15.1_amd64.deb ...
Unpacking libnm-glib4:amd64 (0.9.10.0-4ubuntu15.1) over (0.9.10.0-4ubuntu15) ...
Preparing to unpack .../tzdata_2015d-0ubuntu0.15.04_all.deb ...
Unpacking tzdata (2015d-0ubuntu0.15.04) over (2015c-1) ...
Setting up tzdata (2015d-0ubuntu0.15.04) ...

Current default time zone: 'America/New_York'
Local time is now:      Thu Apr 30 22:20:06 EDT 2015.
Universal Time is now:  Fri May  1 02:20:06 UTC 2015.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

(Reading database ... 171469 files and directories currently installed.)
Preparing to unpack .../ca-certificates_20141019ubuntu0.15.04.1_all.deb ...
Unpacking ca-certificates (20141019ubuntu0.15.04.1) over (20141019) ...
Preparing to unpack .../firefox_37.0.2+build1-0ubuntu0.15.04.1_amd64.deb ...
Unpacking firefox (37.0.2+build1-0ubuntu0.15.04.1) over (37.0+build2-0ubuntu1) ...
Preparing to unpack .../gir1.2-gudev-1.0_1%3a219-7ubuntu4_amd64.deb ...
Unpacking gir1.2-gudev-1.0 (1:219-7ubuntu4) over (1:219-7ubuntu3) ...
Preparing to unpack .../wpasupplicant_2.1-0ubuntu7.1_amd64.deb ...
Unpacking wpasupplicant (2.1-0ubuntu7.1) over (2.1-0ubuntu7) ...
Preparing to unpack .../network-manager_0.9.10.0-4ubuntu15.1_amd64.deb ...
Unpacking network-manager (0.9.10.0-4ubuntu15.1) over (0.9.10.0-4ubuntu15) ...

Broadcast message from root@username-XPS-13-9343 (Thu 2015-04-30 22:20:19 EDT):

Password entry required for 'Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none!' (PID 15391).
Please enter password with the systemd-tty-ask-password-agent tool!

Preparing to unpack .../usb-creator-gtk_0.2.67ubuntu0.1_amd64.deb ...
Unpacking usb-creator-gtk (0.2.67ubuntu0.1) over (0.2.67) ...
Preparing to unpack .../usb-creator-common_0.2.67ubuntu0.1_amd64.deb ...
Unpacking usb-creator-common (0.2.67ubuntu0.1) over (0.2.67) ...
Preparing to unpack .../liboxideqt-qmlplugin_1.6.5-0ubuntu0.15.04.1_amd64.deb ...
Unpacking liboxideqt-qmlplugin:amd64 (1.6.5-0ubuntu0.15.04.1) over (1.5.5-0ubuntu1) ...
Preparing to unpack .../liboxideqtquick0_1.6.5-0ubuntu0.15.04.1_amd64.deb ...
Unpacking liboxideqtquick0:amd64 (1.6.5-0ubuntu0.15.04.1) over (1.5.5-0ubuntu1) ...
Preparing to unpack .../liboxideqtcore0_1.6.5-0ubuntu0.15.04.1_amd64.deb ...
Unpacking liboxideqtcore0:amd64 (1.6.5-0ubuntu0.15.04.1) over (1.5.5-0ubuntu1) ...
Preparing to unpack .../oxideqt-codecs_1.6.5-0ubuntu0.15.04.1_amd64.deb ...
Unpacking oxideqt-codecs:amd64 (1.6.5-0ubuntu0.15.04.1) over (1.5.5-0ubuntu1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu5) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu3) ...
Processing triggers for bamfdaemon (0.5.1+15.04.20150202-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.58ubuntu1) ...
Processing triggers for dbus (1.8.12-1ubuntu5) ...
Processing triggers for systemd (219-7ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for hicolor-icon-theme (0.14-0ubuntu1) ...
Setting up libpam-systemd:amd64 (219-7ubuntu4) ...
Setting up libcurl3-gnutls:amd64 (7.38.0-3ubuntu2.2) ...
Setting up libcurl3:amd64 (7.38.0-3ubuntu2.2) ...
Setting up libgudev-1.0-0:amd64 (1:219-7ubuntu4) ...
Setting up libnm-util2:amd64 (0.9.10.0-4ubuntu15.1) ...
Setting up libnm-glib-vpn1:amd64 (0.9.10.0-4ubuntu15.1) ...
Setting up libnm-glib4:amd64 (0.9.10.0-4ubuntu15.1) ...
Setting up ca-certificates (20141019ubuntu0.15.04.1) ...
Setting up firefox (37.0.2+build1-0ubuntu0.15.04.1) ...
Please restart all running instances of firefox, or you will experience problems.
Setting up gir1.2-gudev-1.0 (1:219-7ubuntu4) ...
Setting up wpasupplicant (2.1-0ubuntu7.1) ...
Setting up network-manager (0.9.10.0-4ubuntu15.1) ...
Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none! 

Broadcast message from root@username-XPS-13-9343 (Thu 2015-04-30 22:20:47 EDT):

Password entry required for 'Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none!' (PID 19822).
Please enter password with the systemd-tty-ask-password-agent tool!

Please enter passphrase for disk Crucial_CT250MX200SSD4 (cryptswap1) on none! 
Setting up usb-creator-common (0.2.67ubuntu0.1) ...
Setting up usb-creator-gtk (0.2.67ubuntu0.1) ...
Setting up oxideqt-codecs:amd64 (1.6.5-0ubuntu0.15.04.1) ...
Setting up liboxideqtcore0:amd64 (1.6.5-0ubuntu0.15.04.1) ...
Setting up liboxideqtquick0:amd64 (1.6.5-0ubuntu0.15.04.1) ...
Setting up liboxideqt-qmlplugin:amd64 (1.6.5-0ubuntu0.15.04.1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ca-certificates (20141019ubuntu0.15.04.1) ...
Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
username@username-XPS-13-9343:~$ 

有人发布了类似的问题这里,但这似乎与 OpenVPN 有关,我没有使用 OpenVPN。反正我也没有这个/etc/default/openvpn文件。

我该如何解决这个问题?

答案1

这是一个已知问题,应该很快就会修复:

https://bugs.launchpad.net/ubuntu/+source/ecryptfs-utils/+bug/1447282

简而言之:在某些情况下,systemd 无法正确识别加密的交换,并提示输入从未设置的密码。如果激活了主目录加密,则交换始终是加密的,因为用户数据可能会被交换出去,然后变为未加密的。

答案2

这不是正确的解决方案,正如 Christian 在下面的评论中所说,这会降低安全性。但如果加密不是您的首要任务,您可以使用此解决方法。

首先找到具有交换的分区

sudo fdisk -l
[sudo] password for kempe: 

Disk /dev/sda: 233,8 GiB, 251000193024 bytes, 490234752 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: B59D4149-AC8E-4B71-B51F-8926B2E82C14

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    409599    407552   199M EFI System
/dev/sda2     409640 253319775 252910136 120,6G Apple HFS/HFS+
/dev/sda3  253321216 269320191  15998976   7,6G Linux swap
/dev/sda4  269320192 490233855 220913664 105,3G Linux filesystem

就我而言,交换/dev/sda3

然后关闭交换

sudo swapoff -a

禁用 cryptswap

sudo cryptsetup remove /dev/mapper/cryptswap1

删除 /etc/crypttab 中的相应行。我只有一行,但你可能有更多行,所以请确保删除正确的行

sudo vim /etc/crypttab 

设置新的交换区域(记住 fstab 输出)

sudo /sbin/mkswap /dev/sda3
sudo swapon /dev/sda3

最后修复 fstab 行

sudo vim /etc/fstab

/dev/mapper/cryptswap1用。。。来代替/dev/sda3

启用和禁用加密交换 - Ubuntu

答案3

我可以通过以下步骤解决此问题:

在命令提示符下运行gnome-disks

找到哪个设备是你的交换驱动器。我的是/dev/sda3

ls -l /dev/disk/by-uuid/

找到与你的交换分区符号链接的 ID

sudo vim /etc/crypttab

在以 cryptswap1 开头的行上,将 UUID=… 部分更改为 /dev/disk/by-id/ID-HERE。保存并重新启动。

如果仍提示您输入密码,请运行:

sudo dd if=/dev/zero of=/dev/sdaX bs=512 count=20480

再次重启。

答案4

这个问题在 Ubuntu 15.10 上也存在。我临时解决了这个问题——关闭了交换分区的加密(主分区仍然加密)。这指导在这种情况下对我有用。此密码请求不再在启动系统和更新软件时警告我。

也许,稍后我会重新打开交换分区的加密(使用相同的指导),我就会知道这个错误已被修复。

相关内容