2015-06-11 238 views
1

將公鑰bitbucket ACCT,ssh -T [email protected]返回(在Windows中)後:Capistrano的部署與到位桶 - 權限被拒絕(公鑰)

The authenticity of host 'bitbucket.org (131.103.20.167)' can't be established. 
RSA key fingerprint is 65:8c:1b:f2:6f:91:6b:5c:3b:ec:4a:46:46:74:7z:40. 
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added 'bitbucket.org' (RSA) to the list of known hosts. 
logged in as myusername. 

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

我們證實bitbucket.org已添加到known_hosts。該cap deploy命令返回:

Host key verification failed. 
fatal: The remote end hung up unexpectedly 

添加了下面的2行deploy.rb文件:

ssh_options[:forward_agent] = true 
default_run_options[:pty] = true 

現在cap deploy返回錯誤:

Permission denied (publickey). 

鍵不被口令保護。如果密鑰被bitbucketssh -T返回正確的信息)接受,爲什麼我們仍然有Permission denied的錯誤。

回答

7

您是否在遠程服務器上運行了ssh -T [email protected]命令,並在那裏確認了它?我剛剛檢查了部署在Capistrano上的Linux服務器,並且在部署用戶的.ssh/known_hosts文件中列出了bitbucket.org(它是散列的,但ssh-keygen -F bitbucket.org顯示了它)。

Capistrano SSH到遠程服務器,並從那裏運行git結帳。它需要連接到Bitbucket的權限,雖然通過:forward_agent選項從源計算機授予訪問權限。

+0

'@Alister Bulman','ssh -T git @ bitbucket.org'在遠程服務器上返回'權限被拒絕',你說得對。我們是否需要在遠程服務器上添加密鑰並將其私鑰添加到bitbucket? – user938363

+0

也謝謝你! – user938363

+0

您只需要確認主機的真實性 - 它可能會失敗,因爲您沒有在簡單的SSH登錄中轉發密鑰,但是它應該會更好地與Capistrano和轉發的代理進行通信。 –

相關問題