Gentoo Archives: gentoo-amd64

From: Tres Melton <tres@××××××××××.com>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] chrrot'ed environment not available to users
Date: Wed, 29 Mar 2006 23:16:01
Message-Id: 1143674069.1810.9.camel@thor.tres.org
In Reply to: [gentoo-amd64] chrrot'ed environment not available to users by Mark Knecht
1 On Thu, 2005-12-08 at 08:46 -0800, Mark Knecht wrote:
2 > Hi,
3 > Thanks for the help yesterday. I now have a partially populated
4 > chroot'ed environment that runs Firefox and a few other things.
5 > Unfortunately it's not available to users:
6 >
7 > mark@lightning ~ $ linux32 chroot /mnt/gentoo32 /bin/bash
8 > chroot: cannot change root directory to /mnt/gentoo32: Operation not permitted
9 > mark@lightning ~ $
10 >
11 > Anyway, thanks in advance for you help.
12 >
13 > cheers,
14 > Mark
15 >
16 Not to knock Billy's idea as it seems valid too but I use a script file:
17
18 #!/bin/bash
19 #
20 # Written and Copyright by Tres Melton (2005)
21 #
22 # Run a 32 bit program from 64 bit space
23 #
24 # If parameters given then execute the command instead of /bin/bash
25 # If no parameters then create a new 32 bit chroot jail shell
26 #
27
28 JAIL_DIR="/mnt/sdb3/Gentoo-32"
29
30 if [ $# -eq 0 ] ; then
31 echo "Starting 32 bit shell..."
32 /bin/linux32 sudo chroot ${JAIL_DIR} /usr/bin/sudo -u "#${UID}" bash -c "( cd ~ ; /bin/bash )"
33 else
34 echo "Starting a 32 bit shell to run \"$*\""
35 /bin/linux32 sudo chroot ${JAIL_DIR} /usr/bin/sudo -u "#${UID}" bash -c "( cd ~ ; $* )"
36 fi
37
38 Now /etc/sudoers needs to allow all users to call chroot and if you
39 don't trust everyone then you may choose to lock some of the parameters
40 and not let them be provided on the CLI. Also each user that uses this
41 should have an account in the 32bit chroot jail as well.
42
43 Cheers,
44 --
45 Tres Melton
46 IRC & Gentoo: RiverRat

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-amd64] Re: chrrot'ed environment not available to users Duncan <1i5t5.duncan@×××.net>