- Create IAM User, select exisiting policy with respective CodeCommit permission
- AWS CodeCommit SSH does not support ED25519 cryptography, has to use RSA
ssh-keygen -t rsa -b 4096 -C "why-dont-support-ed25519"
- Inside the created User, in "Security credentials" tab, upload SSH public key to "SSH keys for AWS CodeCommit"
- Copy the public key into textfield, submit
- A new row will be created, with a generated SSH Key ID, which to be used in the following step
- In
.ssh/config
Host git-codecommit.*.amazonaws.com
AddKeysToAgent yes
UseKeychain yes
User %COPY_FROM_GENERATED_SSH_KEY_ID%
IdentityFile ~/.ssh/codecommit
ssh git-codecommit.ap-northeast-1.amazonaws.com
A successful result will be like this
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'git-codecommit.ap-northeast-1.amazonaws.com' (RSA) to the list of known hosts.
You have successfully authenticated over SSH. You can use Git to interact with AWS CodeCommit. Interactive shells are not supported.Connection to git-codecommit.ap-northeast-1.amazonaws.com closed by remote host.
Connection to git-codecommit.ap-northeast-1.amazonaws.com closed.