Red Hat Bugzilla – Bug 24458
chroot don't change root directory ?
Last modified: 2007-04-18 12:30:48 EDT
Here is an example of what I do:
# cd /some/where
# cp /bin/bash bin/
# ls -l bin/
# -rwxr-xr-x 1 root root 512540 jan 20 16:41 bash
# chroot /some/where
# chroot: cannot execute /bin/bash: No such file or directory
I don't understand, /bin/bash exist and is executable,
with FreeBSD I do that without a problem
This is almost certainly a user mistake:
Our shell is linked dynamically.
Make sure /lib/ld-linux.so.2, /lib/libc.so.6, /lib/libdl.so.2 and
are in the chroot structure. Without them, bash can't be executed.
Alternatively, recompile bash with the "-static" CFLAG. This is what the BSDs do
to their shells.