我的本地笔记本电脑是 Mac。
- ssh 密钥配置正确。这是 ~/.ssh/config 的内容
Host barthea
Hostname git-codecommit.us-east-1.amazonaws.com
User AVVVVVVVVVVVVVVVVVQ
IdentityFile ~/.ssh/aws-aws.pem
运行 ssh barthea 让我
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.
我创建了一个带有密码和访问密钥的 IAM 用户 bruce666,使该用户成为“团队”组的一部分。然后我创建了一个包含“AWSCodeCommitPowerUsers”的策略并将该策略分配给“团队”。最后将 bruce666 分配给“团队”。此时,bruce666 可以通过管理控制台访问 CodeCommit 中的任何存储库。
我运行aws config --profile bruce666,输入他的访问和密钥、他的区域并在 json 中指定格式。此时,我能够通过运行aws codecommit get-repository --repository-name rekha --profile bruce666在 CodeCommmit 中创建 rekha 存储库
我可以创建几个虚拟文件,运行git init,git add 。, git commit -m "1" , git add origin https://git-gitcode.amzonaws.com/repos/v1/rekha , git push -u origin master这样操作就成功了。
但是,当我运行git clone ssh://git-gitcode.amazonaws.com/repos/v1/rekha时,我得到“致命:无法访问'https://git-codecommit.us-east-1.amazonaws。 com/v1/repos/barthia/':请求的 URL 返回错误:403“什么给出?