Capistrano bitbucket - Erlaubnis verweigert (publickey)

Ich versuche, meine Anwendung mit Capistrano auf meinem DigitalOcean-Server bereitzustellen.

Dies ist nicht das erste Mal, dass ich einen RoR-Server in DigitalOcean mit Capistrano-Bereitstellungen konfiguriert habe. Ich habe nichts in meinem Workflow geändert.

Hier ist meine Capistrano-Konfigurationsdatei:

require 'bundler/capistrano'
require 'rvm/capistrano'

set :application, "foobar"
set :repository,  "[email protected]:sergiotapia/foobar.git"
set :ping_url, "http://192.168.1.1/"
set :scm, :git
set :scm_verbose, true
default_run_options[:pty] = true

set :user, "sergiotapia" # The user on the VPS server.
set :password, "hunter2"
set :use_sudo, false
set :deploy_to, "/home/sergiotapia/www/#{application}"
set :deploy_via, :remote_cache
set :keep_releases, 1
set :rails_env, "production"
set :migrate_target, :latest

role :web, "192.168.1.1"
role :app, "192.168.1.1"

namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, roles: :app, except: { no_release: true } do
    run "sudo touch #{File.join(current_path,'tmp','restart.txt')}"
  end
end

# Add this to add the `deploy:ping` task:
namespace :deploy do
  task :ping do
    system "curl --silent #{fetch(:ping_url)}"
  end
end

namespace :gems do
  task :bundle, :roles => :app do
    run "cd #{release_path} && bundle install --without development && rake db:migrate RAILS_ENV=production"
  end
end

after "deploy:update_code", "gems:bundle"

# Add this to automatically ping the server after a restart:
after "deploy:restart", "deploy:ping"

Beim Laufen eincap deploy:setup undcap deploy:check alles kommt grün beleuchtet zurück (funktioniert gut).

Es scheitert am eigentlichencap deploy Befehl.

** [192.168.1.1 :: out] Enter passphrase for key '/home/sergiotapia/.ssh/id_rsa':
Password: 
** [192.168.1.1 :: out]
** [192.168.1.1 :: out] Permission denied (publickey).
** [192.168.1.1 :: out]
** [192.168.1.1 :: out] fatal: Could not read from remote repository.
** [192.168.1.1 :: out]
** [192.168.1.1 :: out]
** [192.168.1.1 :: out] Please make sure you have the correct access rights
** [192.168.1.1 :: out]
** [192.168.1.1 :: out] and the repository exists.
** [192.168.1.1 :: out]

Ich habe meine bereits hinzugefügtid_rsa.pub Datei zu BitBucket und stellte auch sicher, dass es meinem SSH-Agenten hinzugefügt wurdessh-add -l Befehl.

Selbst das Testen von SSH vom Remote-Server aus funktioniert einwandfrei:

sergiotapia@tappia:~/www$ ssh -T [email protected]
logged in as sergiotapia.

You can use git or hg to connect to Bitbucket. Shell access is disabled.

Was gibt es also, warum verweigere ich den Zugriff auf das Repository auf BitBucket?

Läuft Capistrano als ein anderer Benutzer alssergiotapia? Wäre das die Ursache dafür?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage