本文翻译自:Change key pair for ec2 instance
How do I change the key pair for my ec2 instance in AWS management console? 如何在AWS管理控制台中为我的ec2实例更改密钥对? I can stop the instance, I can create new key pair, but I don't see any link to modify the instance's key pair. 我可以停止实例,可以创建新的密钥对,但是看不到任何修改实例密钥对的链接。
#1楼
参考:https://stackoom.com/question/X4KT/更改EC-实例的密钥对
#2楼
This answer is useful in the case you no longer have SSH access to the existing server (ie you lost your private key). 如果您不再具有对现有服务器的SSH访问权限 (即,丢失了私钥) ,则此答案很有用。
If you still have SSH access, please use one of the answers below. 如果您仍然具有SSH访问权限,请使用以下答案之一。
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-lost-key-pair https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-lost-key-pair
Here is what I did, thanks to Eric Hammon