簡體   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