Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to execute script file with +x permission, even with sudo

I am unable to run scripts from a mounted partition. I have created a basic "Hello World" script that will execute from my home directory fine, but when I move it to the mounted partition, I am unable to execute the file.

$ ls -l
-rwxr-xr-x  1 user user    31 Mar  4 21:33 test.sh
$ ./test.sh
-bash: ./test.sh: Permission denied
$ sudo ./test.sh
[sudo] password for user:
sudo: unable to execute ./test.sh: Permission denied
$ cd ..
$ ls -l
drwxrwxrwx  6 user root  4096 Mar  4 21:34 sda5

I have no idea what to do.

ETA: I am able to use "bash test.sh" to execute the file, just not ./test.sh. I am able to do ./test.sh in the home directory.

like image 701
user1539179 Avatar asked Mar 05 '13 02:03

user1539179


1 Answers

The file system was mounted with noexec which prevented executing files.

like image 179
user1539179 Avatar answered Oct 03 '22 08:10

user1539179