[systemd-devel] sshd inside in a nspawn container

Albert Strasheim fullung at gmail.com
Sun Apr 3 09:01:52 PDT 2011


Hello all

On Sun, Apr 3, 2011 at 4:59 PM, Albert Strasheim <fullung at gmail.com> wrote:
> pam_loginuid(sshd:session): set_loginuid failed

This one is caused by:

32    open("/proc/self/loginuid", O_WRONLY|O_TRUNC|O_NOFOLLOW) = 4
32    write(4, "0", 1)                  = -1 EPERM (Operation not permitted)

This happens regardless of whether systemd-nspawn is run with sudo or
directly as root.

> pam_systemd(sshd:session): Failed to get user data.

This is caused by my user ID not being present in the passwd file in
the container.

If I login to the host machine as root and then run systemd-nspawn
this error disappears, but the write to /proc/self/loginuid still
doesn't succeed.

> pam_unix(sshd:session): session opened for user root by (uid=0)
> error: PAM: pam_open_session(): Cannot make/remove an entry for the
> specified session

This is caused by a call to

socket(PF_NETLINK, SOCK_RAW, 9)   = -1 EPROTONOSUPPORT

NETLINK_AUDIT=9, so it seems getting rid of auditing might be more
difficult than audit=0.

Regards

Albert

P.S. I managed to get a shell going based on rescue.service so that I
could strace sshd running inside the container.


More information about the systemd-devel mailing list