Replace the pem file for an EC2 instance running Windows

0

I'm looking for some guidance on replacing the pem file associated with an EC2 instance running Windows.

The AWS documentation on key pairs for Windows doesn't seem to mention this, and the general advice seems more geared towards Linux.

I have the old pem file and just want to replace it for security reasons. Any help would be appreciated!

Resources I've read through so far are below:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-key-pair
https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-key-pairs.html

질문됨 3년 전2602회 조회
1개 답변
1

Good day Jamielaird

According to my understanding you are trying to replace a .pem key file that is associated with an existing EC2 instance running Windows for security reasons.

Based on my investigation and replication to your question, these are the steps I followed:
Note: To give the new key pair the same name as the old key pair, you must first delete the old key pair

1.Create a new key pair, and then save the private key file in a safe place. You can create a key pair using the console, the AWS CLI, or AWS Tools for Windows PowerShell.
2. From the Amazon EC2 console, choose Instances from the navigation pane.
3. Select your instance
4. Stop your instance
5. Select your instance. For Actions, choose Image, Create Image. For Image name, enter a name.
6. Create Image, and then choose Close.
7. Launch an AMI - Launch an instance.
8. Complete the wizard. Be sure to select the same Instance type, VPC ID, Subnet ID, Security groups, and IAM role as the instance that you are replacing For Select a key pair, choose the new key pair.
9. Now that the private key file is replaced, you can reset the administrator password.

To reset your administrator password:
Use EC2Config for Windows Server 2012 R2 and earlier. https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Launch.html

Use EC2Launch for Windows Server 2016 and later https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Config.html

References
[1] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-windows-replace-lost-key-pair/

Lihle
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠