So I read through a bunch of posting about similar issues, but none of them seemed to fix this problem. I am running netbeans 7.3.1 on ubuntu 12.04.2 x64. I wrote some fortran code and saved it to an ext4 internal drive that I have. However, when I try and run the code through netbeans or even from the console, I tend to get a permission denied error. But, when I save and compile the code in my home directory, it seems to run just fine.

Now as a pre-empt to the common issues. the partition that is having the trouble is an ext4 partition, so it is not a FAT or NTFS partition where I cannot run executables from Ubuntu. Second, the drive is set for permission to run executables. I mount the drive through pysdm and the run binaries flag is enabled. I am not sure how to check the drive settings though.

I am including some samples of the console output when I compile the file and when the execution error comes up.

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/media/jaimini/workspace/netbeans/Hello_1'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/hello_1  
make[2]: Entering directory `/media/jaimini/workspace/netbeans/Hello_1'
make[2]: `dist/Debug/GNU-Linux-x86/hello_1' is up to date.
make[2]: Leaving directory `/media/jaimini/workspace/netbeans/Hello_1'
make[1]: Leaving directory `/media/jaimini/workspace/netbeans/Hello_1'

Here is the run attempt:

/bin/sh: 1: exec: /media/jaimini/workspace/netbeans/Hello_1/dist/Debug/GNU-Linux-x86/hello_1:
Permission denied

RUN FINISHED; exit value 126; real time: 0ms; user: 0ms; system: 0ms

Any suggestions. This is really messing up my workflow. Thanks.

  • Can you please check if /media/jaimini/workspace/netbeans/Hello_1/dist/Debug/GNU-Linux-x86/hello_1 has execute permission? Jun 20, 2013 at 3:08
  • The permissions on the file are set for execute. See the output below. -rwxrwxr-x 1 krishnab krishnab 10507 Jun 19 18:31 hello_1
    – krishnab
    Jun 20, 2013 at 3:16

1 Answer 1


Normally for a script to be executed, apart from script's execute permission, all the parent directories of that script from the root (/) should have execute permission. See below for an example.

~$ ls -ltrh | grep Temp
dr-xr-xr-x  2 thefourtheye thefourtheye 4.0K Jun 20 08:53 Temp

~$ chmod 666 Temp

~$ ls -ltrh | grep Temp
drw-rw-rw-  2 thefourtheye thefourtheye 4.0K Jun 20 08:53 Temp

~$ Temp/TestIP.sh
bash: Temp/TestIP.sh: Permission denied

~$ chmod 755 Temp

~$ ls -ltrh | grep Temp
drwxr-xr-x  2 thefourtheye thefourtheye 4.0K Jun 20 08:53 Temp

~$ Temp/TestIP.sh
Your IP Address   :
Your N/W Mask     :
Your N/W Address  : 10 0 2 0
IPs to be Checked : 4060477953

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.