gpt4 book ai didi

amazon-web-services - AWS CLI : Key is not in valid OpenSSH public key format

转载 作者:行者123 更新时间:2023-12-04 08:01:37 24 4
gpt4 key购买 nike

如何解决这个问题?

# I used this command to create the key with a password
$ ssh-keygen -b 2048 -t rsa -C "awsfrankfurt" -f ~/.ssh/awsfrankfurt

# Then when I try to import it into AWS EC2, the error appears:
$ aws --region eu-central-1 ec2 import-key-pair \
--key-name "awsfrankfurt" \
--public-key-material ~/.ssh/awsfrankfurt

An error occurred (InvalidKey.Format) when the ImportKeyPair operation:
Key is not in valid OpenSSH public key format

最佳答案

AWS 仅支持 RSA key 对,不支持 DSA , ECDSAEd25519 key 对。如果您尝试上传非 RSA公钥你会得到这个错误。

这是记录在案 here :

Amazon EC2 does not accept DSA keys. Make sure your key generator is set up to create RSA keys.



该错误消息具有误导性,因为您可以上传有效的非 RSA键并得到错误:
Error import KeyPair: InvalidKey.Format: Key is not in valid OpenSSH public key format

对于在搜索此错误消息后找到此页面的人,此答案应该很有用。

关于amazon-web-services - AWS CLI : Key is not in valid OpenSSH public key format,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43875990/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com