Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 Key Pair Change

I have seen several questions and answers about changing the EC2 key pair for a running instance. However I am a complete AWS newbie at this point and I can easily stop the running instance and restart it. That's not a problem in our situation.

Is it possible to stop a running EC2 instance and somehow change the key pair and then start it again on an EBS-backed instance? We are also using an elastic IP on this instance so I can't see any downside of stopping the instance and restarting, but most discussions of changing the key pair assume that restarting an instance is difficult.

I'm not an ops person, I'm trying to get up to speed after our recent EC2 person has left the company.

Thanks in advance!

like image 726
Blake Schwendiman Avatar asked Dec 20 '22 04:12

Blake Schwendiman


1 Answers

No, you can't change the key pair for an instance using AWS management console. The only way to change the key is explained here: Change key pair for ec2 instance

In a nutshell, SSH key is a file, created in the EC2 instance by AWS during setup. Once the file is there, AWS is not touching it. It's only you who can work with it.

like image 88
yegor256 Avatar answered Jan 07 '23 02:01

yegor256