简体   繁体   English

无法 ssh 到 AWS 代码提交存储库,公钥内容更改

[英]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:当我上传到 IAM 时,以下公钥(修改后)更改为不同的格式:

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

changes to following format (modified) when I view the popup by clicking show SSH key:当我通过单击显示 SSH 密钥查看弹出窗口时,更改为以下格式(已修改):

-----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我的配置文件(修改后)是: 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我使用了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:如果您成功设置了 SSH,则使用您的 SSH 密钥 ID 克隆存储库:

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?您能否在 IAM 设置中确认用户 ssh 密钥 ID 与您的 .ssh/config 文件匹配?

  2. Are you seeing this issue on Windows or Mac?您是否在 Windows 或 Mac 上看到此问题? Does this happen with other IAM users that have this SSH key?其他拥有此 SSH 密钥的 IAM 用户会发生这种情况吗?

  3. Can you try following the steps on this page, particularly step 3?您可以尝试按照此页面上的步骤操作,尤其是第 3 步吗? Links below depending on if your Windows or Mac/Unix.下面的链接取决于您的 Windows 还是 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 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.您的 ssh 代理可能不知道要使用哪个私钥。

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.此外,添加“-v”可能会为您提供有关正在发生的事情的更多信息。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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