How to overcome "Permission denied" running C program even after "chmod +x"?

5,299

One possible reason is that you are compiling on a file system that has been mounted with the noexec option.

Run mount -l to see the options that file systems are mounted with.

Share:
5,299

Related videos on Youtube

Nagendra Kumar
Author by

Nagendra Kumar

Updated on September 18, 2022

Comments

  • Nagendra Kumar
    Nagendra Kumar over 1 year

    After compiling a C program on Ubuntu 10.10, after executing chmod +x ./a.out, I am still getting bash: ./a.out: Permission denied. How can I run my new executable?

    • Deepak Verma
      Deepak Verma almost 12 years
      Are you the owner of the file? You're not building as root, are you (using sudo, etc)?