Recently I was working on a project which involved setting up sftp and rsync but having user locked to their home directory using chroot. The sftp part is easy, as it’s built into OpenSSH, but the rsync part was more difficult. One of the tools I was using is called Jailkit. It’s a very nifty tool that helps by copying not only the binary file you need but the library files that go with it.
So here I was chugging along and things were going smoothly until suddenly I couldn’t login. No matter what I tried I go the error ‘/bin/bash: permission denied‘. I was still logged in as root at this point, but couldn’t switch to any other user account. I tried everything I could think of.
After a whole lot of Googling, I finally found a tip pointing to a specific library file having the wrong permissions, in my case, the file is ‘ld-2.23.so‘ located in the ‘/lib/x86_64-linux-gnu‘ directory. It should be 755 but had been changed to 700. I can’t confirm it was Jailkit, but it makes sense that it was.
So a quick ‘chmod 755 /lib/x86_64-linux-gnu/ld-2.23.so‘ and I was back and running. Beats a fresh install 😉