I had this same error "/bin/bash: No such file or dirctory" that many others on getting on this thread. The actual reason for this error isn't that /bin/bash is missing in your chrooted directory. It's a library dependency that /bin/bash is missing. Using the script in the how-to didn't resolve to copy all of the dependent libraries needed by /bin/bash to your chrooted directory. To find out which ones are missing, you start by doing a 'ldd /bin/bash';
Code:
> ldd /bin/bash
libtermcap.so.2 => /lib/libtermcap.so.2
libdl.so.2 => /lib/libdl.so.2
libc.so.6 => /lib/tls/libc.so.6
/lib/ld-linux.so.2
then you go down that list and see if they're in you chrooted dir.
Code:
> ls /home/chroot/lib/libtermcap.so.2
/home/chroot/lib/libtermcap.so.2
> ls /home/chroot/lib/libdl.so.2
/home/chroot/lib/libdl.so.2
> ls /home/chroot/lib/tls/libc.so.6
/home/chroot/lib/tls/libc.so.6
> ls /home/chroot/lib/lib/ld-linux.so.2
ls: /home/chroot/lib/lib/ld-linux.so.2: No such file or directory
As it turned out, I was missing "/lib/ld-linux.so.2" in my chrooted directory. Copying that to my chrooted dir fixed my problem. I've only tested this on a CentOS 4.4 installation, but this might work for others as well.
I hope this solves your problem
Recent comments
6 hours 54 min ago
11 hours 53 min ago
13 hours 19 min ago
14 hours 12 min ago
15 hours 55 min ago
20 hours 18 min ago
21 hours 11 min ago
23 hours 24 min ago
1 day 12 hours ago
1 day 14 hours ago