2015-06-11 185 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和转发的代理进行通信。 –

相关问题