Macos Capistrano-无法部署代码,因为;拒绝许可(公钥)。”;

Macos Capistrano-无法部署代码,因为;拒绝许可(公钥)。”;,macos,git,ssh,capistrano,bitbucket,Macos,Git,Ssh,Capistrano,Bitbucket,当我运行capistrano将代码部署到服务器时,会收到以下错误消息: ... ** Execute git:check DEBUG[18c8f63a] Running /usr/bin/env git ls-remote -h git@bitbucket.org:name/project.git on 107.170.160.89 DEBUG[18c8f63a] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/project/git-ssh.sh /

当我运行capistrano将代码部署到服务器时,会收到以下错误消息:

...
** Execute git:check
DEBUG[18c8f63a] Running /usr/bin/env git ls-remote -h git@bitbucket.org:name/project.git on 107.170.160.89
DEBUG[18c8f63a] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/project/git-ssh.sh /usr/bin/env git ls-remote -h git@bitbucket.org:name/project.git )
DEBUG[18c8f63a]     Permission denied (publickey).
DEBUG[18c8f63a]     fatal: The remote end hung up unexpectedly
DEBUG[18c8f63a] Finished in 0.478 seconds with exit status 128 (failed).
我对存储库具有管理员权限。当我运行ssh add-l时,我看到一条“/Users/adam/.ssh/id_rsa(rsa)”记录

这里怎么了

编辑:
当我在ubuntu服务器上运行
ssh bitbucket.org
时,我得到了
权限被拒绝(公钥)。

你的问题不清楚——你能在Capistrano之外成功访问bitbucket上的存储库吗?例如,您可以从命令行
git clone
存储库吗?我可以将数据推送到存储库,我在那里有管理员访问权限。运行
ssh-bitbucket.org
时,您可能会看到“权限被拒绝”,因为您使用了错误的用户名。尝试
sshgit@bitbucket.org
并查看您得到了什么(它应该会给您一条信息性消息,我希望它能起作用,因为您可以
git-push
)。