title: Capistrano deploy failing with scp: /tmp/<project_name>/git-ssh.sh: Permission denied
body: <p>I'm tearing my hair out here. I assume the deploy user, in this case <code>www-data</code>, doesn't have sufficient privileges make the necessary directory. Or is this an SSH related problem?</p>
  
  <p>I'm using Capistrano 3.5 to deploy onto Ubuntu 15.10.</p>
  
  <p>Here's the full trace</p>
  
  <pre><code>00:00 git:wrapper
        01 mkdir -p /tmp/project_name/
      ✔ 01 www-data@88.xxx.xxx.xxxx
  (Backtrace restricted to imported tasks)
  cap aborted!
  scp: /tmp/project_name/git-ssh.sh: Permission denied
  
  Tasks: TOP =&gt; git:check =&gt; git:wrapper
  (See full trace by running task with --trace)
  The deploy has failed with an error: scp: /tmp/project_name/git-ssh.sh: Permission denied
  
  ** DEPLOY FAILED
  ** Refer to log/capistrano.log for details. Here are the last 20 lines:  
  
    INFO ---------------------------------------------------------------------------
    INFO START 2016-05-18 17:34:33 +0100 cap production deploy
    INFO ---------------------------------------------------------------------------
    INFO [a283be11] Running /usr/bin/env mkdir -p /tmp/project_name/ as www-data@88.xxx.xxx.xx
   DEBUG [a283be11] Command: /usr/bin/env mkdir -p /tmp/project_name/
    INFO [a283be11] Finished in 2.160 seconds with exit status 0 (successful).
   DEBUG Uploading /tmp/project_name/git-ssh.sh 0.0%
  </code></pre>
  
  <h2>Edit for Kenster</h2>
  
  <p>on server ran</p>
  
  <pre><code>ls -lR /tmp/&lt;project_name&gt;
  </code></pre>
  
  <p>output </p>
  
  <pre><code>/tmp/&lt;project-name&gt;:
  total 4
  -rwxr-xr-x 1 root root 93 May 17 22:21 git-ssh.sh
  </code></pre>