From owner-freebsd-questions@FreeBSD.ORG Wed Apr 22 09:53:59 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0792335D for ; Wed, 22 Apr 2015 09:53:59 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE8FE1A6E for ; Wed, 22 Apr 2015 09:53:58 +0000 (UTC) Received: from r56.edvax.de (port-92-195-64-237.dynamic.qsc.de [92.195.64.237]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id C45133CDD0; Wed, 22 Apr 2015 11:45:33 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t3M9jWTq004355; Wed, 22 Apr 2015 11:45:32 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 22 Apr 2015 11:45:32 +0200 From: Polytropon To: jd1008 Cc: FreeBSD Users Subject: Re: chroot question Message-Id: <20150422114532.4b61e65f.freebsd@edvax.de> In-Reply-To: <5536C277.30204@gmail.com> References: <5536C277.30204@gmail.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Wed, 22 Apr 2015 09:53:59 -0000 On Tue, 21 Apr 2015 15:34:47 -0600, 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. That might be the answer: If /bin/bash really exists (which is a "non-standard extension" on FreeBSD) _and_ it's a symlink, a test "if it's an executable" will probably fail. If you can place an _actual_ binary of /bin/bash, try that, and repeat the test. If not, specify its actual location for that user (using "chsh "). This is bash's standard installation target on FreeBSD: % which bash /usr/local/bin/bash Keep in mind that things like #!/bin/bash are considered a "Linuxism" and therefore NOT PORTABLE. Butif I remember correctly, you can run "make configure" for the bash port and set an option to enable that kind of functionality. Anyway, check "ls -la /bin/bash" for anything suspicious, just to make sure _what_ permissions could have been denied, and _why_. > So, what is chroot good for??? See "man chroot": "change root directory". :-) PS. I have excluded the Fedora list you've been parallel-posting to because I'm not subscribed there. I assume that your question targets FreeBSD. If _not_, consult "info chroot" on your Linux distribution. Fedora Community Users Support EXCLUDED. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...