【发布时间】:2015-12-08 18:25:18
【问题描述】:
我正在尝试在带有 GIT 和 openSSH 的 Windows 10 上使用 AWS CodeCommit。我可以成功连接 Putty,但我不想使用它。 我在 ~/.ssh/id_rsa 中创建了一个密钥并将其上传到 AWS 控制台。 因此,如果我尝试在 GitBash 中与 ssh 连接,它就会起作用。
$ ssh git-codecommit.us-east-1.amazonaws.com
You have successfully authenticated over SSH.
You can use Git to interact with AWS CodeCommit.
Interactive shells are not supported.
Connection to git-codecommit.us-east-1.amazonaws.com closed by remote host.
Connection to git-codecommit.us-east-1.amazonaws.com closed.
但是如果我尝试拉它不起作用。
$ git pull
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我检查了我的 SSH 密钥 ID,它是正确的。
$ git remote -v
origin ssh:/***********@git-codecommit.us-east-1.amazonaws.com/v1/repos/myrepo (fetch)
origin ssh:/***********@git-codecommit.us-east-1.amazonaws.com/v1/repos/myrepo (push)
SSH 连接接缝也适用于我的 SSH 密钥 ID:
$ ssh ***********@git-codecommit.us-east-1.amazonaws.com
我在另一台 Windows PC 上成功配置了一周。
有人有同样的问题吗?有什么想法有什么问题吗?
【问题讨论】:
-
至少从 git pull 中的输出来看,您的 ssh 密钥是有效的,似乎对于您无权访问的特定 git 存储库
-
即使我的 ssh 密钥无效,我也总是收到 Permission denied。
-
您配置它的另一台 Windows PC 正在使用另一个 IAM 用户。附加了正确的 CodeCommit 策略的一种。尝试比较两个 IAM 用户。 (并在此处发布提示,我有完全相同的问题:-)
-
是同一个用户。它只是一台办公电脑和一台家用电脑。
-
如果您使用的是 git 2.3.0+,您可以使用以下命令获取 SSH 连接的详细输出。查找“提供 RSA 公钥”以查看 SSH 客户端正在使用哪些密钥:GIT_SSH_COMMAND="ssh -v" git pull
标签: git amazon-web-services ssh aws-codecommit