Unable to execute bash scripts even as root?

Marcin picture Marcin · Nov 11, 2011 · Viewed 36.7k times · Source

I have a weird problem, I cant execute bash script even as basic as:

#!/bin/bash
echo "me"

I am saving it as a test.sh and then do chmod 755 test.sh and once run ./test.sh getting:

bash: ./test.sh: Permission denied

Any ideas what could be causing this?

Answer

themel picture themel · Nov 11, 2011

That can happen if you have mounted the file system with the "noexec" option. You should remove it.