Cannot execute /bin/bash: Permission denied

October 21st, 2008 | by Sean |

Just a quick note, just in case someone else sees this message. I got this error this morning when I logged in as a non-root user on a Slackware server I’d upgraded yesterday. In an act of blind faith, I used ‘slackpkg upgrade-all’, and then the fun began.

Incidentally, if you’re in Malaysia, and you’re downloading Slackware packages at the 8kB/s which seems to be all TM Net / Streamyx can manage with their “best effort” basis from nearby countries, download from Brazil – I get a reliable 180kB/s on a 1Mbit/s connection. Yes, that’s right folks. TM Net give you 5% of your rated download from any country in smuggling distance, but can max out your connection from the other side of the world! Answers on a postcard, please.

Back to the problem. I tried some fairly obvious fixes to do with checking permissions on directories and executables, none seemed to work. Then I searched online and found http://linuxgazette.net/issue52/okopnik.html where the same problem was traced to the permissions on /lib/ld-linux.so.2, or rather, the permissions on the file it links to. On my system, changing the permissions to 755 on /lib/ld-2.7.so didn’t allow me to login as a non-root user, but did give me errors like:

error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory

Much easier to track down! It seems slackpkg had installed several libraries in /lib with insufficient permissions, all with the version string “2.7” in them. All these libraries seem to depend on /lib/ld-linux, according to ldd.

I’d wish you ‘Have fun!’, but my eyes are still throbbing from staring at this error for so long.

  1. One Response to “Cannot execute /bin/bash: Permission denied”

  2. By Jash on Jan 8, 2009 | Reply

    I did the same thing, slackware 12.0 to 12.2 and ran into this problem (among many others).

    This really helped me, thanks.

Post a Comment