fatal: cannot exec ‘/tmp/…/git-ssh.sh’: Permission denied – Capistrano, Dreamhost, permission denied for git-ssh.sh

Problem

When trying to use the new Capistrano 3.x to set up your rails project in a dreamhost account, you get the following error complaining that the git-ssh.sh script copied to your account by capistrano cannot be executed as the permission is denied:

fatal: cannot exec '/tmp/example.com/git-ssh.sh': Permission denied

Solution

It seems that Dreamhost, and quite possibly other hosting providers are not allowing executables from the /tmp directory, which is where Capistrano places the git-ssh.sh script. So in order to be able to execute the script you can change the directory where the script is copied in the first place and put it in your home directory. You can do that by adding the following to the config/deploy.rb file:

set :tmp_dir, "/home/dh_user_name/tmp"

capistrano deployment fails after dreamhost server move

Problem
You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with ‘permission denied’ when trying to get the git repository.

Solution
As the server was moved you would need to copy your ssh public key from the deployment server to the new server again for the password-less logins to work again.
Follow the details here how to copy your public key across, login in once with your password, and after that your capistrano recipe should be working again as normal.