Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2015 08:51:47 +1000
From:      Cameron Simpson <cs@zip.com.au>
To:        FreeBSD Users <freebsd-questions@freebsd.org>, Fedora Community Users Support <users@lists.fedoraproject.org>
Subject:   Re: chroot question
Message-ID:  <20150421225147.GA84979@cskk.homeip.net>
In-Reply-To: <5536C277.30204@gmail.com>
References:  <5536C277.30204@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21Apr2015 15:34, jd1008 <jd1008@gmail.com> wrote:
>As root, I ran
>chroot --userspec=user2:user2 /home/user2
>chroot: failed to run command ‘/bin/bash’: Permission denied
>
>The dir /home/user2 has in it
>all the *bin and *lib  (links) and usr/*bin and usr/*lib files and subdirs.
>
>So, what is chroot good for???

Hmm, on what platform? You posted to fedora and freebsd lists.

I would guess that there is some permissions problem with the copies of 
/bin/bash (and whatever libraries it links) such that user2 cannot run it, as 
suggested by the "Permission denied" message.

On Linux, strace can tell you about this.

BTW, loopback mounts are probably a better way to get specific stuff inside a 
chroot before you lock the door. No copies, and no permissions to preserve.

Cheers,
Cameron Simpson <cs@zip.com.au>

If I had thought about it, I wouldn't have done the experiment.
The literature was full of examples that said you can't do this.
      --Spencer Silver on the work that led to the unique adhesives
        for 3-M "Post-It" Notepads.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150421225147.GA84979>