git pull时拒绝位桶权限公钥

问题描述

当我尝试从位桶中拉出时,出现以下错误。我在一个AWS ECS实例中:

git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我已经将ssh密钥添加到位存储桶帐户访问密钥,并尝试将密钥添加到我的存储库本身。早些时候,我已经成功地将代码推送到了存储桶中,但从未进行过拉取。

解决方法

尝试“ Troubleshooting SSH connections to AWS CodeCommit”中列出的第一种方法

在bash中,您可以执行以下操作:

GIT_SSH_COMMAND="ssh -v" git pull

这将向您显示Git用于该操作的shs密钥:您可以检查其公钥确实是您在AWS账户/ ECS实例中设置的公钥。