On Fri, 30 Mar 2018 20:47:20 +0100 James Le Cuirot wrote: > On Fri, 30 Mar 2018 20:23:49 +0100 > James Le Cuirot wrote: > > > I did just have a lightbulb moment though. I've been playing with > > unshare recently and I wondered if we could leverage it here. > > > > $ sudo unshare -m /bin/sh -c "mount --bind /mnt/somewhere/etc /etc && groupadd foo" > > groupadd: Cannot determine your user name. > > Aha! I was trying to do this against an NFS share for a system with a > different architecture. If I use a local mount with a compatible > architecture, it actually does work. I'll explore this some more. Figured it out! The system I was doing this against has an ancient glibc (long story) with an old nsswitch.conf. I replaced this file with a newer one and it all started working. Do you agree this could be the way forwards? -- James Le Cuirot (chewi) Gentoo Linux Developer