繁体   English   中英

AWS Codecommit和GIT openSSH连接

[英]AWS Codecommit and GIT openSSH connection

我正在尝试在具有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上成功配置了一周。

有人有同样的问题吗? 任何想法有什么问题吗?

感谢克莱尔·利古里(Clare Liguori)的小费。 它不适用于GIT_SSH_COMMAND,但您可以将其用于详细信息如何使用SSH详细模式运行git push / pull命令?

所以我发现我的master分支的SSH KEY ID仍然是错误的。 我只运行git remote set-url original ...但没有更改我的master分支。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM