Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I once generated an executable file using g++ on a linux box. But when I try to run this executable file on another linux machine, the system said "Permission denied". However, after I re-compile the source code on this second machine and run the executable file, the program just runs fine.

Can you let me know what may be the problem?


migration rejected from stackoverflow.com Dec 31 '14 at 18:07

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as unclear what you're asking by psusi, Hauke Laging, jimmij, Networker, Braiam Dec 31 '14 at 18:07

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

what are the permissions bits of the file? Try: chmod +x <file> – Yves Junqueira Mar 20 '11 at 22:16
Perhaps the partition that you're trying to execute the file is mounted with the noexec flag activated? – ierax Mar 21 '11 at 9:09
What is the output of ls -l /path/to/executable_file? – Hauke Laging Dec 31 '14 at 17:04