[systemd-devel] systemd-nspawn

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Apr 15 11:36:33 PDT 2013


On Mon, Apr 15, 2013 at 02:31:56PM -0300, Chir0n wrote:
> Hello
> 
> 
> 
> I don't know if this is the right place for this question. Tell me if this
> is the
> case.
It's OK.

> I'm trying to execute the Example 1 of the following tutorial and I can't
> log with any user. I get an authentication
> error.
> 
> 
> http://0pointer.de/public/systemd-man/systemd-nspawn.html
> 
> 
> 
> More precisely I'm executing the following
> command:
> 
> 
> 
> # yum -y --releasever=19 --nogpg --installroot=/srv/mycontainer
> --disablerepo='*' --enablerepo=fedora install systemd passwd yum
> fedora-release vim-minimal
> # systemd-nspawn -bD
> /srv/mycontainer
> 
> 
> 
> Is there something I need
> do?
You're probably being tripped-up by audit stupidity. If you have a kernel
newer not older than 3.8, then you can just spawn a shell in the namespace:

  sudo nsenter -t $PID -m -u -i -n -p /bin/bash

where PID is printed by systemd-nspawn right before launching the
container. Then in the container you can investiagate stuff if normal
ways, with journalctl and whatnot.

Otherwise, have a look at journalctl -D /src/mycontainer/var/log/journal.

On a Fedora 19 host with a Fedora 19 container, I see:
Apr 15 14:25:54 fedora-19 login[22]: pam_unix(login:auth): authentication failure; logname
= uid=0 euid=0 tty=console ruser= rhost=  user=root
Apr 15 14:25:56 fedora-19 login[22]: PAM audit_log_acct_message() failed: Operation not pe
rmitted
Apr 15 14:25:56 fedora-19 login[22]: FAILED LOGIN SESSION FROM console FOR root, System er

And also:
bash-4.2# passwd
Changing password for user root.
New password: 
Retype new password: 
passwd: System error

The workaround might be to run the *host* with audit=0 on the commandline.

Zbyszek

> PS: I tried to use chroot to change the root pass, I tried to use my local
> users and I tried to log with empty passwords, but anything worked.
I think that by default all accounts are disabled.

Zbyszek


More information about the systemd-devel mailing list