簡體   English   中英

Capistrano 3.2.1中的git身份驗證錯誤

[英]git authentication error in capistrano 3.2.1

我已經將server_users rsa.pub鍵添加到git中,我得到的錯誤是

Running /usr/bin/env git ls-remote -h http://git.example.com/nishant/pro-gasket.git on 52.24.70.121
DEBUG[c40f8fa6] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/pro-gasket/git-ssh.sh /usr/bin/env git ls-remote -h http://git.example.com/nishant/pro-gasket.git )
DEBUG[c40f8fa6]     fatal: Authentication failed for 'http://git.example.com/nishant/pro-gasket.git/'
DEBUG[c40f8fa6]     
DEBUG[c40f8fa6] Finished in 1.549 seconds with exit status 128 (failed).
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 52.24.70.121: exit
/home/codebajra/.rvm/gems/ruby-2.1.3@pro-gasket/gems/capistrano-3.2.1/lib/capistrano/tasks/git.rake:28:in `exit'  

服務器中的git版本是1.9.1

由於服務器使用ssh連接到github,因此將repourl用於ssh一個。

除了-的基本知識

  • 確保在遠程主機上安裝了git,並且
  • 確保失敗的用戶有權訪問存儲庫

您可能會遇到一種情況,要么您的部署剛剛停止工作,要么它們正在為某些用戶而不為其他用戶工作-即您知道遠程主機已正確設置。

在這種情況下,失敗的用戶可能未將其SSH密鑰本地添加到ssh代理中-這是必需的,因為Capistrano使用SSH代理轉發(即,將本地ssh密鑰轉發到遠程主機)。

要解決此問題,請確保您的代理正在(本地)運行,如下所示:

eval `ssh-agent -s`

然后添加您的密鑰

ssh-add

驗證已添加您的身份,如下所示:

ssh-add -l

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM