Dan*_*Dan 5 git ssh aws-codecommit
在确定如何使AWS CodeCommit与标准SSH身份验证协同工作时遇到极其困难的时间.看到这样的另一个话题,但没有答案,我不能发表评论.这是在Windows上使用Git Bash.
这是我从SSH获得的DEBUG3日志记录:
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/Dan/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug2: input_userauth_pk_ok: fp SHA256:<omitted>
debug3: sign_and_send_pubkey: RSA SHA256:<same-as-above>
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
fatal: Could not read from remote repository.
Run Code Online (Sandbox Code Playgroud)
为了比较,这是我使用与GitHub完全相同的SSH密钥:
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/Dan/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug2: input_userauth_pk_ok: fp SHA256:<same-as-above>
debug3: sign_and_send_pubkey: RSA SHA256:<same-as-above>
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([192.30.252.130]:22).
Run Code Online (Sandbox Code Playgroud)
以上输出来自运行正常的git命令,例如git push origin master
启用了ssh debug logging .ssh/config
:
Host git-codecommit.us-east-1.amazonaws.com
LogLevel DEBUG3
Host github.com
LogLevel DEBUG3
Run Code Online (Sandbox Code Playgroud)
Wad*_*nko 10
看起来你错过了设置SSH的一步.您需要将此信息添加到.ssh/config文件中:
Host git-codecommit.us-east-1.amazonaws.com
User Your-SSH-Key-ID, such as APKAEIBAERJR2EXAMPLE
IdentityFile Your-Private-Key-File, such as ~/.ssh/codecommit_rsa or ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
您可以从IAM控制台获取Your-SSH-Key-ID.
小智 8
所以 git clone 应该是这样的:
git clone ssh://<SSHKEY-ID>@git-codecommit.<REGION>.amazonaws.com/v1/repos/<REPO-NAME>
Run Code Online (Sandbox Code Playgroud)
小智 5
Host git-codecommit.us-west-2.amazonaws.com
User SSHKEYID
IdentityFile ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5830 次 |
最近记录: |