title: Bash permission denied on Linux
body: <p>I was doing the "bof" problem on <a href="http://pwnable.kr/play.php" rel="nofollow noreferrer">http://pwnable.kr/play.php</a>
  I downloaded the "bof" file. But when I use gdb, it says as follows:</p>
  
  <pre><code>Starting program: /home/henry/Downloads/bof 
  /bin/bash: /home/henry/Downloads/bof: Permission denied
  /bin/bash: line 0: exec: /home/henry/Downloads/bof: cannot execute: Permission denied
  During startup program exited with code 126.
  </code></pre>
  
  <p>bof.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  void func(int key){
      char overflowme[32];
      printf("overflow me : ");
      gets(overflowme);   // smash me!
      if(key == 0xcafebabe){
          system("/bin/sh");
      }
      else{
          printf("Nah..\n");
      }
  }
  int main(int argc, char* argv[]){
      func(0xdeadbeef);
      return 0;
  }
  </code></pre>