Search code examples
amazon-web-servicesamazon-ec2private-keypublic-keykey-pair

Change private keys of EC2 instance


I have two servers (instances) with private keys, I want to change those keys without stopping the servers (instances) or creating new ones.

Is this possible?


Solution

  • You can add or replace a key pair for your instance: Amazon EC2 key pairs and Linux instances - Amazon Elastic Compute Cloud

    Also, have a look at the following guide. It describes a case where the initial key pair had been lost but—if I understand your question—should also be applicable to your situation: Connect to an Amazon EC2 Instance When the SSH Key Pair Is Lost