Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2015 11:45:32 +0200
From:      Polytropon <freebsd@edvax.de>
To:        jd1008 <jd1008@gmail.com>
Cc:        FreeBSD Users <freebsd-questions@freebsd.org>
Subject:   Re: chroot question
Message-ID:  <20150422114532.4b61e65f.freebsd@edvax.de>
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 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 <username>"). 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 <users@lists.fedoraproject.org>
EXCLUDED.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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