From owner-freebsd-questions@FreeBSD.ORG Tue Apr 21 22:58:54 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD2022C7 for ; Tue, 21 Apr 2015 22:58:54 +0000 (UTC) Received: from nschwqsrv01p.mx.bigpond.com (nschwqsrv01p.mx.bigpond.com [61.9.189.231]) by mx1.freebsd.org (Postfix) with ESMTP id 68CCD18BC for ; Tue, 21 Apr 2015 22:58:54 +0000 (UTC) Received: from nschwcmgw08p ([61.9.190.168]) by nschwmtas06p.mx.bigpond.com with ESMTP id <20150421225156.EUJN3884.nschwmtas06p.mx.bigpond.com@nschwcmgw08p>; Tue, 21 Apr 2015 22:51:56 +0000 Received: from buttercup ([203.174.191.230]) by nschwcmgw08p with BigPond Outbound id Jmrp1q00U4yinA301mruL2; Tue, 21 Apr 2015 22:51:56 +0000 X-Authentication-Info: Submitted using ID cskk@bigpond.com X-Authority-Analysis: v=2.0 cv=F6HVh9dN c=1 sm=1 a=krPVgHGjbsUbHPB5Q/CjkA==:17 a=yEdEr6MRgwAA:10 a=IkcTkHD0fZMA:10 a=vrnE16BAAAAA:8 a=ZtCCktOnAAAA:8 a=e9J7MTPGsLIA:10 a=pGLkceISAAAA:8 a=cGEsK-4qxMyXr9dYOQsA:9 a=QEXdDO2ut3YA:10 a=krPVgHGjbsUbHPB5Q/CjkA==:117 Received: from fleet.l (localhost [127.0.0.1]) by buttercup (Postfix) with ESMTP id CFFB17FE46; Wed, 22 Apr 2015 08:53:23 +1000 (EST) Received: by fleet.l (Postfix, from userid 501) id A192E1680333; Wed, 22 Apr 2015 08:51:47 +1000 (AEST) Date: Wed, 22 Apr 2015 08:51:47 +1000 From: Cameron Simpson To: FreeBSD Users , Fedora Community Users Support Subject: Re: chroot question Message-ID: <20150421225147.GA84979@cskk.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5536C277.30204@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) References: <5536C277.30204@gmail.com> X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2015 22:58:54 -0000 On 21Apr2015 15:34, jd1008 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 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.