chroot option for loginutils
vda.linux at googlemail.com
Fri May 13 01:15:36 UTC 2011
On Thursday 12 May 2011 20:22, Sergey Naumov wrote:
> I recently asked whether adduser / addgroup / passwd can be used to
> set up users/groups on a target system from host machine. It is rather
> simple to add root user and create password with htpasswd, but if I
> want to create several users like quagga, snmp, stunnel and so on I
> need to do it "by hands". I have created a draft patch to busybox to
> support "-C root " option for adduser, addgroup, passwd, deluser,
> delgroup instead of reinventing the bicycle.
Well, this would be an incompatible addition...
Did you ask upstream what do they think?
How do their users do that? Chroot jail?
> If it is interesting for somebody I can refurbish it.
To be honest, the code doesn't look very good, purely from technical POV.
Can it be coded simpler?
I'd try to use chroot() and depend in it making
/DIR/etc/passwd appear as /etc/passwd.
More information about the busybox