-3

i only remember my key name ,how can re download my key pair in my computer,or how can i attach new keypair to my instance

bigmakers
  • 11
  • 1
  • 1
  • 1

2 Answers2

1

SSH keys can only be downloaded at the moment of creation. You can create an image from your instance and redeploy it with a new SSH keypair.

ma.tome
  • 1,179
  • 8
  • 15
  • This is why when you spin up a server you click a checkbox saying you realize if you lose a key your access to the instance isn't their problem – Michael Bailey Jul 15 '15 at 21:17
0

An EC2 key pair private key file (*.pem) can only be downloaded when the key pair is created. If you have lost it, you cannot recover it.

EC2 Key pairs can only be assigned to an EC2 instance when the EC2 instance is created. It cannot be changed or assigned-to later on.

It is very important to preserve and protect your key pairs to prevent problems like these.

Your only recourse at this time is to create an AMI image from your EC2 instance and launch a new instance with a new or different key pair.

Matt Houser
  • 10,053
  • 1
  • 28
  • 28