I'm trying to deploy with Capistrano3 connecting to git server by SSH. It is OK to connect to server by using normal git command. But using capistrano isn't.
Error message
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as serveruser@xx.xx.xx.xx: git exit status: 128
git stdout: Nothing written
git stderr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: The remote end hung up unexpectedly
deploy.rb
# config valid only for current version of Capistrano
lock '3.4.0'
set :application, 'Sample'
set :repo_url, 'ssh://serveruser@xx.xx.xx.xx:22/var/lib/git/public_git/sample.git'
set :deploy_to, '/app/Sample'
set :scm, :git
production.rb
server 'xx.xx.xx.xx', user: 'serveruser', roles: %w{app db web}, my_property: :my_value
role :app, %w{serveruser@xx.xx.xx.xx}, my_property: :my_value
set :ssh_options, {
keys: %w(/Users/localuser/.ssh/id_rsa),
forward_agent: false,
auth_methods: %w(password)
# password: 'please use keys'
}
Am I Missing any points?