我正在尝试使用systemd-nspawn,但当我启动它并尝试以root用户身份登录时,它仍然要求输入密码。他们提到关闭审计--我就是这么做的。
我的cmd行的末尾是audit=0。
$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.19.7-200.fc21.x86_64 root=/dev/mapper/fedora_localhost-root ro rd.lvm.lv=fedora_localhost/swap rd.lvm.lv=fedora_localhost/root rhgb audit=0 quiet(这是fedora 21)使用这些文档https://fedoraproject.org/wiki/Features/SystemdLightweightContainers
当我尝试更改密码时,它告诉我有一个身份验证令牌操作错误。
$ sudo systemd-nspawn -D /srv/eq1
Spawning container eq1 on /srv/eq1.
Press ^] three times within 1s to kill container.
-bash-4.3# passwd
Changing password for user root.
New password:
Retype new password:
passwd: Authentication token manipulation error
-bash-4.3# 发布于 2015-08-05 04:48:18
它是关于selinux上下文的,几乎遵循http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html的示例6。
您必须更改容器上下文,然后使用适当的上下文运行它:
chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container
systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -D /srv/container在发出第二个命令之后,您就可以更改密码了。在容器之后]你可以发出通常的"systemd-nspawn /CTRL+“命令并引导你的容器。
https://stackoverflow.com/questions/30848520
复制相似问题