Re: [systemd-devel] Enter in systemd-nspawn as specific user

2014-10-02 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Oct 02, 2014 at 12:48:31PM +0200, Miroslav Suchy wrote: > On 10/02/2014 11:49 AM, Lennart Poettering wrote: > > There's nspawn's --user= switch which relies on glibc's "getent" > > binary to be available in the container, which it will use to resolve > > the username in the container's cont

Re: [systemd-devel] Enter in systemd-nspawn as specific user

2014-10-02 Thread Simon McVittie
On 02/10/14 10:09, Miroslav Suchy wrote: > If I want to become specific user inside of that container, I have to do > something like: > > /usr/bin/systemd-nspawn -D foo /bin/su -l mockbuild -c 'rpmbuild -root > \'/build\' ...' > > which quickly go into escape-hell. If you put a better privilege-

Re: [systemd-devel] Enter in systemd-nspawn as specific user

2014-10-02 Thread Miroslav Suchy
On 10/02/2014 11:49 AM, Lennart Poettering wrote: > There's nspawn's --user= switch which relies on glibc's "getent" > binary to be available in the container, which it will use to resolve > the username in the container's context and then change to it. Perfect! However if I do: # /usr/bin/system

Re: [systemd-devel] Enter in systemd-nspawn as specific user

2014-10-02 Thread Colin Walters
On Thu, Oct 2, 2014, at 05:09 AM, Miroslav Suchy wrote: > Hi, > when I run systemd-nspawn, I become root user inside of that container. > If I want to become specific user inside of that container, I have to do > something like: You might also be interested in: https://git.gnome.org/browse/linux-u

Re: [systemd-devel] Enter in systemd-nspawn as specific user

2014-10-02 Thread Lennart Poettering
On Thu, 02.10.14 11:09, Miroslav Suchy (msu...@redhat.com) wrote: > Hi, > when I run systemd-nspawn, I become root user inside of that container. > If I want to become specific user inside of that container, I have to do > something like: > > /usr/bin/systemd-nspawn -D foo /bin/su -l mockbuild -c