title: What is a deploy user in Capistrano?
body: <p>I'm trying to get my head around Capistrano. </p>
  
  <p>What is an ssh deploy user? I've got shared hosting space with ssh access and I usually do ssh myuser@domain.com and it authenticates with private RSA keys. </p>
  
  <p>This is the output I get trying to do a deploy</p>
  
  <pre><code>** Invoke production (first_time)
  ** Execute production
  ** Invoke load:defaults (first_time)
  ** Execute load:defaults
  ** Invoke deploy (first_time)
  ** Execute deploy
  ** Invoke deploy:starting (first_time)
  ** Execute deploy:starting
  ** Invoke deploy:check (first_time)
  ** Execute deploy:check
  ** Invoke git:check (first_time)
  ** Invoke git:wrapper (first_time)
  ** Execute git:wrapper
  INFO [ee6098c8] Running /usr/bin/env mkdir -p /tmp/tempdirname/ as myuser@serveripaddress
  DEBUG [ee6098c8] Command: /usr/bin/env mkdir -p /tmp/tempdirname/
  DEBUG [ee6098c8]    stdin: is not a tty
  INFO [ee6098c8] Finished in 0.942 seconds with exit status 0 (successful).
  DEBUG Uploading /tmp/tempdirname/git-ssh.sh 0.0%
  INFO Uploading /tmp/tempdirname/git-ssh.sh 100.0%
  INFO [f4f1f009] Running /usr/bin/env chmod +x /tmp/tempdirname/git-ssh.sh as myuser@serveripaddress
  DEBUG [f4f1f009] Command: /usr/bin/env chmod +x /tmp/tempdirname/git-ssh.sh
  DEBUG [f4f1f009]    stdin: is not a tty
  INFO [f4f1f009] Finished in 0.164 seconds with exit status 0 (successful).
  ** Execute git:check
  INFO [3788f5f2] Running /usr/bin/env git ls-remote --heads git@bitbucket.blah/tempdirname-static.git as myuser@serveripaddress
  DEBUG [3788f5f2] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/tempdirname/git-ssh.sh /usr/bin/env git ls-remote --heads git@bitbucket.blah/tempdirname-static.git )
  DEBUG [3788f5f2]    stdin: is not a tty
  DEBUG [3788f5f2]    /usr/bin/env: 
  DEBUG [3788f5f2]    git
  DEBUG [3788f5f2]    : No such file or directory
  DEBUG [3788f5f2]    
  cap aborted!
  SSHKit::Runner::ExecuteError: Exception while executing as myuser@serveripaddress: git exit status: 127
  git stdout: Nothing written
  git stderr: stdin: is not a tty
  /usr/bin/env: git: No such file or directory
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
  SSHKit::Command::Failed: git exit status: 127
  git stdout: Nothing written
  git stderr: stdin: is not a tty
  /usr/bin/env: git: No such file or directory
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status='
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:66:in `execute'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/git.rb:11:in `git'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/git.rb:21:in `check'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/tasks/git.rake:28:in `block (4 levels) in &lt;top (required)&gt;'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/tasks/git.rake:27:in `block (3 levels) in &lt;top (required)&gt;'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
  /Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
  Tasks: TOP =&gt; git:check
  The deploy has failed with an error: Exception while executing as myuser@serveripaddress: git exit status: 127
  git stdout: Nothing written
  git stderr: stdin: is not a tty
  /usr/bin/env: git: No such file or directory
  ** Invoke deploy:failed (first_time)
  ** Execute deploy:failed
  </code></pre>
  
  <p>This is my deploy.rb</p>
  
  <pre><code># config valid only for Capistrano 3.3.5
  lock "3.4.0" # change the version to the capistrano version you are using - I used capistrano version 3.3.5
  
  set :application, "name"
  #set :deploy_user, "your-ssh-deploy-user"
  set :deploy_user, "user"
  
  # setup repo details
  set :repo_url, "git@bitbucket.org:user/reponame.git"
  set :scm, :git
  
  # how many old releases do we want to keep, not much
  set :keep_releases, 2
  </code></pre>
  
  <p>this is my production.rb</p>
  
  <pre><code>set :stage, :production # or :staging or :your_environment
  set :branch, "master" # or another branch, for example "development"
  
  # used in case we're deploying multiple versions of the same
  # app side by side. Also provides quick sanity checks when looking
  # at filepaths
  set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}"
  
  #server 'your-ip-address', user: 'your-ssh-deploy-user', roles: %w{web app db}, primary: true
  server 'ipaddress', user: 'myuser', roles: %w{web app db}, primary: true
  
  set :deploy_to, "/home/dir/blah/blah"
  
  # whether we're using ssl or not, used for building nginx
  # config file
  set :enable_ssl, false
  
  #role :app, %w{deploy@your-ip-address}
  #role :web, %w{deploy@your-ip-address}
  #role :db,  %w{deploy@your-ip-address}
  role :app, %w{myuser@myipaddress}
  role :web, %w{myuser@myipaddress}
  role :db,  %w{myuser@myipaddress}
  </code></pre>
  
  <p>I followed this
  <a href="http://www.frick-web.at/blog/capistrano-deployment-setup-for-php-projects" rel="nofollow">http://www.frick-web.at/blog/capistrano-deployment-setup-for-php-projects</a></p>