简体   繁体   English

AWS Codecommit和GIT openSSH连接

[英]AWS Codecommit and GIT openSSH connection

I'm trying to use AWS CodeCommit on Windows 10 with GIT and openSSH. 我正在尝试在具有GIT和openSSH的Windows 10上使用AWS CodeCommit。 I can successfully connect with Putty but I don't want to use it. 我可以成功连接Putty,但我不想使用它。 I created a key in ~/.ssh/id_rsa and uploaded it to AWS Console. 我在〜/ .ssh / id_rsa中创建了一个密钥,并将其上传到了AWS控制台。 So if I try to connect with ssh in GitBash than it works. 因此,如果我尝试在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.

But if I try to pull it doesn't work. 但是,如果我尝试拉,那是行不通的。

$ 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.

I checked my SSH Key ID, it's correct. 我检查了我的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 connection seams also to work with my SSH Key ID: SSH连接缝也可以与我的SSH密钥ID一起使用:

$ ssh ***********@git-codecommit.us-east-1.amazonaws.com

I successfully configured it on another Windows PC for a week. 我在另一台Windows PC上成功配置了一周。

Does anybody have the same issue? 有人有同样的问题吗? Any Idea what can be wrong? 任何想法有什么问题吗?

Thanks Clare Liguori for a tip. 感谢克莱尔·利古里(Clare Liguori)的小费。 It didn't work with GIT_SSH_COMMAND but you can use this for verbose How can I run git push/pull commands with SSH verbose mode? 它不适用于GIT_SSH_COMMAND,但您可以将其用于详细信息如何使用SSH详细模式运行git push / pull命令?

So I found out that my SSH KEY ID for master branch was still wrong. 所以我发现我的master分支的SSH KEY ID仍然是错误的。 I only run git remote set-url original ... but i didn't change my master branch. 我只运行git remote set-url original ...但没有更改我的master分支。

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

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