Solution for "Permission denied" in a chroot environment
So,
I was preparing manually a chroot environment for some things we're doing at work, and I stumbled across this very strange problem when i tried to enter the chroot with "chroot .":
chroot: failed to run command `/bin/bash': Permission denied
/bin/bash was existing, and it also had the executable flag...
Debugging with strace, didn't bring up much else:
execve("/bin/bash", ["/bin/bash", "-i"], [/* 31 vars */]) = -1 EACCES (Permission denied)
So what happened?
While I was copying files around for the chroot, the executable flag on /lib64/ld-linux-x86-64.so.2 was lost... Since this is the program interpreter, it needs to be executable as well.. sigh