Search code examples
linuxbashcentospermission-denied

Unable to execute bash scripts even as root?


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?


Solution

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