Capistrano部署与bitbucket - 权限被拒绝(公钥) [英] Capistrano deploy with bitbucket - Permission denied (publickey)
问题描述
在 bitbucket
acct中添加公钥后, ssh -T git@bitbucket.org
返回(在windows中) :
主机'bitbucket.org(131.103.20.167)'的真实性无法建立。
RSA密钥指纹是65:8c:1b:f2:6f:91:6b:5c:3b:ec:4a:46:46:74:7z:40。
您确定要继续连接(是/否)吗?是
警告:将bitbucket.org(RSA)永久添加到已知主机列表中。
以myusername身份登录。
您可以使用git或hg连接到Bitbucket。外壳访问被禁用。
我们证实 bitbucket.org
已被添加到 known_hosts
。 cap deploy
命令返回:
主机密钥验证失败。
致命:远程端意外挂起
我们将以下两行添加到 deploy.rb
file:
ssh_options [:forward_agent] = true
default_run_options [:pty] = true
现在 cap deploy
返回错误:
权限被拒绝(publickey)。
密码不受密码保护。如果密钥被 bitbucket
( ssh -T
返回正确信息)接受,为什么我们仍然有 Permission denied
。
ssh -T git@bitbucket.org 命令在远程服务器上,并在那里确认?我刚刚检查了部署在Capistrano上的Linux服务器,并且bitbucket.org在部署用户的.ssh / known_hosts文件中列出(它已散列,但> ssh-keygen -F bitbucket.org
显示它)。
Capistrano SSH到远程服务器,并从那里运行git checkout。它需要连接到Bitbucket的权限,虽然通过:forward_agent
选项从源计算机授予访问权。
After adding public key to bitbucket
acct, ssh -T git@bitbucket.org
returns (in windows):
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.
We verified that bitbucket.org
has been added to known_hosts
. The cap deploy
command returns:
Host key verification failed.
fatal: The remote end hung up unexpectedly
We added the following 2 lines to deploy.rb
file:
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
Now cap deploy
returns error:
Permission denied (publickey).
Keys are not passphrase protected. If the key is accepted by bitbucket
(ssh -T
returns right info), why we still have the error of Permission denied
.
Have you run the ssh -T git@bitbucket.org
command on the remote server, and confirmed it there? I've just checked a Linux server I deploy onto with Capistrano, and bitbucket.org is listed in the deploying user's .ssh/known_hosts files (it's hashed, but ssh-keygen -F bitbucket.org
shows it).
Capistrano SSHes into the remote server, and runs the git checkout from there. It needs permission to connect to Bitbucket, although the access is granted from the source machine, via the :forward_agent
option.
这篇关于Capistrano部署与bitbucket - 权限被拒绝(公钥)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!