create new user

Sergio Schvezov sergio.schvezov at canonical.com
Thu Jun 11 16:18:08 UTC 2015


On Thu, Jun 11, 2015 at 03:51:25PM +0100, roger peppe wrote:
> On 11 June 2015 at 15:27, Sergio Schvezov <sergio.schvezov at canonical.com> wrote:
> > On Thu, Jun 11, 2015 at 03:13:01PM +0100, roger peppe wrote:
> >> I'd quite like to make a new user on my snappy instance (so that I don't
> >> need to use "ssh ubuntu at ..." every time), but I get this response:
> >>
> >> ubuntu at localhost:~$ sudo adduser rog
> >> Adding user `rog' ...
> >> Adding new group `rog' (1001) ...
> >> groupadd: cannot lock /etc/group; try again later.
> >> adduser: `/usr/sbin/groupadd -g 1001 rog' returned error code 10. Exiting.
> >> ubuntu at localhost:~$
> >>
> >> What am I doing wrong?
> >
> > Nothing, /etc/group and /etc/passwd are read only.
> >
> > Someone needs to teach adduser to look at lib-nssextrausers
> 
> So is there an accepted way of adding a new user, or
> should I just live with ubuntu for now?
> 
> Presumably you mean libnss-extrausers there? Interesting,
> and not something I'd come across before. Perhaps I can
> just manually add a line to
> /var/lib/extrausers/{password,group,shadow,gshadow} ?

Yes, it should work,
http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk/view/head:/live-build/ubuntu-core/hooks/01-setup_user.chroot

I guess you will have issues with all the snappy commands and $HOME
afterwards, but it's a good thing to start testing/instrumenting if
you are up to it.



More information about the snappy-devel mailing list