aws codecommit cannot push

…衆ロ難τιáo~ 提交于 2019-12-02 04:14:02

问题


I setup my new repo in aws codecommit. I'm totally new to this.

I can clone my repo using this

git clone ssh://APKAISIJVIU6XXXXXX@git-codecommit.us-east-1.amazonaws.com/v1/repos/weewee my-demo-repo

However when I try to push I get this message

Permission denied (publickey). fatal: Could not read from remote repository.

I setup the config file and the credentials as instructed in AWS.

I can't find what I'm missing.


回答1:


Do you have multiple public keys in your ~/.ssh directory?

If you have an id_rsa.pub in ~/.ssh but did not choose to upload that one to the IAM console then you will need to configure your .ssh/config to use the public key that you chose with the user name that you are specifying.

For example, if you have created and uploaded the public key named codecommit_rsa.pub (per the documentations), then you will need to add the following lines to your ~/.ssh/config

Host git-codecommit.*.amazonaws.com
  User APKAISIJVIU6XXXXXX
  IdentityFile ~/.ssh/codecommit_rsa

Let me know if this helps!

Yilun



来源:https://stackoverflow.com/questions/39904327/aws-codecommit-cannot-push

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!