我正在尝试在带有 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 上成功配置了一周。
有人有同样的问题吗?任何想法有什么问题?