2

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

I can clone my repo using this

git clone ssh://[email protected]/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 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.