Trying to run a NZBGet (Python) Script, I've tried to run manually with:


but this results in:

bash: /mnt/local/ext001/MEDIA/NZBGet/scripts/videosort/VideoSort.py: Permission denied

I've tried running this as sudo and SU and permissions are 777 currently, but still get the same message. How can permission be denied?

EDIT: It seems the partition is mounting with noexec, despite using the following:

/mnt/local/ext001 ext4 auto,rw,exec,async,user,suid,noatime,nodiratime,relatime 0 2

Any idea why it is not accepting the exec option?

  • When you're situated in ../videosort/ dir, could you run the script without problems?
    – tachomi
    Dec 22, 2014 at 23:26
  • 5
    Every time you do chmod 777, somewhere in the world a kitten dies
    – janos
    Dec 23, 2014 at 0:23
  • Is the partition mounted with noexec? Dec 23, 2014 at 0:44
  • @janos I changed it to 777 to test it, surely if it is 777 it should be fine to execute with open permissions? Dec 25, 2014 at 8:47
  • @MarkWagner no, it is exec: /mnt/local/ext001 ext4 auto,rw,exec,async,user,suid,noatime,nodiratime,relatime 0 2 Dec 25, 2014 at 8:48

4 Answers 4


You're right that the order of the mount options is important here. From the man page:

   users  Allow every user to mount  and  unmount  the  filesystem.   This
          option  implies  the  options  noexec, nosuid, and nodev (unless
          overridden  by  subsequent  options,  as  in  the  option   line

The exec option is before the users option, not subsequent to it, so the users option overrides it and sets the volume to noexec.


If python is executable and you don't want to remount partition (or can't), you can just run:

python /mnt/local/ext001/MEDIA/NZBGet/scripts/videosort/VideoSort.py

If you want to run a elf(linux binary executable file) file without the execute permission, you can:

/lib/ld-linux.so.* /path/to/elf/file

  • I'm sure this would have worked, but it did not fix the problem, not being able to execute the python script was just the symptom in this case. But thanks. Dec 26, 2014 at 23:35

You need make your file executable.

chmod +x /mnt/local/ext001/MEDIA/NZBGet/scripts/videosort/VideoSort.py  


chmod 555 /mnt/local/ext001/MEDIA/NZBGet/scripts/videosort/VideoSort.py  

then, you can run that:

  • It was already executable, I was using incorrect placement of /etc/fstab mount options, this resulted in it being mounted as 'noexec'. Thanks for your input however. Dec 26, 2014 at 23:35
  • what's the key difference between chmod +x and chmod 555?
    – 3pitt
    May 30, 2018 at 17:35

In some compilers, like vsCode, you need to type "python" instead of "python3" to overcome that.

Eg -:

python manage.py startapp chat

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .