【发布时间】:2016-04-03 17:17:11
【问题描述】:
我的本地笔记本电脑是 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 中的任何 repo。
-
我运行了 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“什么给出?
【问题讨论】:
标签: git amazon-web-services aws-codecommit