This is an odd one, it only happens on one server (shared hosting, so I have limited access to configuration and logs), but I can't wrap my head around it.I have a shell script which runs some app's deployment. The file has a +x flag, but I can't run it by simply calling its name from shell, I get an access denied error. Invoking bash with the filename as an arguments works like a charm. It looks something like that:[someuser@someserver:~] $cat test.shecho hooray![someuser@someserver:~] $chmod +x test.sh[someuser@someserver:~] $ls -l test.sh-rwxrwxr-x 1 someuser someuser 14 Oct  8 11:27 test.sh[someuser@someserver:~] $./test.sh-bash: ./test.sh: Permission denied[someuser@someserver:~] $bash test.shhooray!Adding a #!/bin/bash at the beginning doesn't help. I also tried from other shell (default is bash, tried in sh), same thing happened.This is not that big of a problem, but it's baffling for me. What could be the cause?
Shell script permission denied despite +x flag
permissions;bash;scripting;shell
I think it is because of the noexec mount option for the folder your script is in.You may try to check that by this commandmount | grep `df -P /path/to/folder/with/script | tail -1 | cut -d ' ' -f 1`