简体   繁体   中英

unable to ssh to AWS codecommit repository, public key contents change

Below public key (modified) when I upload to IAM changes to a different format:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZeqQA7Uc+dsdfasWqqqqqqqqqqqqqq6hvmFLZHfoVsebiGkW5t0g6wCaaaaaaaaaaaaaauD0rsW/IoWsYC95Ax5Kdo5N1yGkIs2m1l6DP0JCx1FuZN6DPp4HcccccVmfA3s88BTC84890qdfffffffffffffffff1/0HSqJyBTGrplZcFSesX7cVUGRdiOEF1iBW743 xxxxx@xxxx-VirtualBox

changes to following format (modified) when I view the popup by clicking show SSH key:

-----BEGIN PUBLIC KEY-----
MIIBIjAdddddddddddw0BAQEFAAOCAQ8AMIIBCgKCAQEA2XqkAO1HPjT4wKDFl4J8
OmNe3CWrsdfasdfasdfR36FbHm4hpF111111111111Z
PXWsR1kVRbR9g8cfqqqqqqqqqqqveQMeSnaOTdchpCLNptZegz9CQsdR
bmTegz6eB67Vu/ddddddddvewyjrL18paSWVnx1u
3RdBn7+v7b8XIz7yFQb8ddddddddG7lokf/Rgp78dq9rln
LWN8HNrKfiJ0oR7xWEVNsSChuHNf9B0qicgUxq6ZWXBUnrF+3FVBkXYjhBdYgVu+
NwIDAQAB
-----END PUBLIC KEY-----

Is this the reason I always get following error:

ssh git-codecommit.eu-west-1.amazonaws.com
sign_and_send_pubkey: signing failed: agent refused operation
Permission denied (publickey).

My config file (modified) is: cat .ssh/config

Host git-codecommit.eu-central-1.amazonaws.com
User APsssssssDDDDDDDwwwAQ
IdentityFile ~/.ssh/id_rsa

I cannot understand what is going wrong. I used the instructions in https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-without-cli.html#setting-up-without-cli-add-key

If you set up your SSH successfully, then use your SSH key ID to clone the repo:

git clone ssh://<YOUR_SSH_KEY_ID>@git-codecommit.us-east-2.amazonaws.com/v1/repos/<MY_REPO_NAME>

Hope that helps.

I'm sorry to hear about your problem. Can you answer these questions to help us find what the issue is?

  1. Can you confirm within the IAM settings that the User ssh key-id matches up with your .ssh/config file?

  2. Are you seeing this issue on Windows or Mac? Does this happen with other IAM users that have this SSH key?

  3. Can you try following the steps on this page, particularly step 3? Links below depending on if your Windows or Mac/Unix.

https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-windows.html

The "agent refused operation" message is an odd one. It might be possible that your ssh agent doesn't know which private key to use.

You could try doing

ssh-add ~/.ssh/id_rsa

and then attempting authentication again. Also, adding "-v" might give you more information about what's going on.

ssh -v git-codecommit.eu-central-1.amazonaws.com

因为您正在尝试验证来自 eu-west-1 区域的ssh配置,而您的配置文件是 eu-central-1。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM