On Fri, November 25, 2016 2:01 pm, Dave Cohen wrote:
> I'm new to `chroot`.  Trying to make sandbox where I can build and run
> untrusted code without affecting the base system.
>
> Following instructions from
> https://www.ibm.com/developerworks/community/blogs/karsten/entry/openbsd_chroot?lang=en,
> I am at the point where I can `doas chroot /jails/untrusted/` and I have
> root access to my chroot environment.  So far, so good.
>
> Next I try to make a non-root user in the chroot environment, but run into
> trouble doing so.  For example, this complaint that /etc/shells is
> missing:
>
> # adduser
> Couldn't find /etc/adduser.conf: creating a new adduser configuration file
> Reading /etc/shells
> /etc/shells: No such file or directory
>
>
> This is solved easily enough, copying /etc/shells from my base install to
> /jails/untrusted/etc/shells.  But I quickly run into a similar problem
> because /etc/master.passwd is missing.
>
> I'm not sure I want to use the /etc/master.passwd from the base install in
> the chroot.  Also, I suspect that I'll run into more problems like this.
> Have I missed a step in initializing my chroot directory?  Is there a
> recommended way to create files like /etc/master.passwd the same as
> created by the openbsd installer?
>
> Thanks for any help!
>

It's an old how-to.  There are no etc sets anymore.  Did you run sysmerge
in  the chroot or otherwise extact the etc tarball out of the base
tarball?

Also, depending on what you're trying to do in the chroot, maybe look into
leveraging proot from ports.

Reply via email to