1

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?

1
  • 2
    Are you the owner of the file? You're not building as root, are you (using sudo, etc)? Jul 8, 2012 at 20:16

2 Answers 2

2

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.

0

If you are compiling the program and running the executable file on an external drive or something similar, move the file to Desktop and recompile and run it there.

0

You must log in to answer this question.

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