Replace a lost key pair for an Amazon EC2 Windows instance (2024)

I used EC2Config or EC2Launch to try to reset a lost password. I lost the private key file for the key pair that I use to launch my Amazon Elastic Compute Cloud (Amazon EC2) Windows instance.

Resolution

Follow these steps to replace a lost key pair.

Use the AWSSupport-ResetAccess Automation runbook

To use the AWSSupport-ResetAccess Automation runbook to replace a lost key pair or local administrator password, see Reset passwords and SSH keys on EC2 instances.

Create an AMI, and launch a new instance

When you use EC2Config, EC2Launch, or EC2Lanuch v2 to reset a lost password, use its key pair to retrieve the administrator password. If you lost the key pair, then create an Amazon Machine Image (AMI) of your instance, and launch a new instance. Then, use the instance launch wizard to select a new key pair.

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

Complete the following steps:

  1. Create a new key pair, and then save the private key file. You can use the Amazon EC2 console, AWS CLI, or AWS Tools for Windows PowerShell to create the key pair.
    Note: To give the new key pair the same name as the lost key pair, you must first delete the lost key pair.
  2. Open theAmazon EC2 console, and in the navigation pane choose Instances.
  3. Select your instance. From the Details tab, note the Instance type, VPC ID, Subnet ID, Security groups, and AWS Identity and Access Management role (IAM) role for the instance.
  4. Stop your instance.
    Warning: When an instance has an instance store volume, data on the volume is lost when the instance is stopped. When the instance shutdown behavior is set to Terminate, the instance terminates when it's stopped.
  5. Select your instance. Choose Actions, and then choose Image and templates, Create Image. Enter the following information:
    For Image name, enter a name.
    (Optional) For Image description, enter a description.
  6. Choose Create Image, and then choose Close.
  7. In the navigation pane, choose AMIs. When the Status is available, continue to the next step.
  8. Select the AMI, and then choose Launch instance from AMI.
  9. Use the launch instance wizard to launch the instance. Be sure to select the same Instance type, VPC ID, Subnet ID, Security groups, and IAM role as the instance that you replace. Also, make sure to select a new key pair.
  10. (Optional) If the original instance has an associated Elastic IP address, then allocate the Elastic IP address to the new instance.
  11. (Optional) If any Amazon Elastic Block Store (Amazon EBS) volumes aren't captured during AMI creation, then detach the volume and attach it to the new instance.
    Note: When you detach the volume, you don't need to unmount the volume because the original instance is already in the Stopped state.
  12. Reset the administrator password. Use EC2Config for Windows Server 2012 R2 or earlier or EC2Launch for Windows Server 2016 or later. If you use a supported Windows AMI that includes EC2Launch v2, then use EC2Launch v2.
  13. (Optional) To clean up, you can terminate the stopped instance that has the lost key pair. Also, after you launch the new instance, you can delete the AMI.
    Note: If you store AMIs, then you might incur additional costs. If you no longer need the AMI, then delete the AMI.

Related information

Amazon EC2 key pairs and Windows instances

Tutorial: Get started with Amazon EC2 Windows instances

Replace a lost key pair for an Amazon EC2 Windows instance (2024)
Top Articles
Reliable STAT to BTC Conversion: Rate Calculator | Bitsgap
Convert 10000 SATS to USD - Satoshi to US Dollar Converter | CoinCodex
Somboun Asian Market
Cold Air Intake - High-flow, Roto-mold Tube - TOYOTA TACOMA V6-4.0
Urist Mcenforcer
Ffxiv Shelfeye Reaver
Craftsman M230 Lawn Mower Oil Change
Wisconsin Women's Volleyball Team Leaked Pictures
Cad Calls Meriden Ct
Wmu Course Offerings
Top Financial Advisors in the U.S.
Corpse Bride Soap2Day
Optum Medicare Support
Pbr Wisconsin Baseball
454 Cu In Liters
Turning the System On or Off
7 Low-Carb Foods That Fill You Up - Keto Tips
4156303136
Painting Jobs Craigslist
Pricelinerewardsvisa Com Activate
Kamzz Llc
FDA Approves Arcutis’ ZORYVE® (roflumilast) Topical Foam, 0.3% for the Treatment of Seborrheic Dermatitis in Individuals Aged 9 Years and Older - Arcutis Biotherapeutics
Finalize Teams Yahoo Fantasy Football
Japanese Mushrooms: 10 Popular Varieties and Simple Recipes - Japan Travel Guide MATCHA
Zillow Group Stock Price | ZG Stock Quote, News, and History | Markets Insider
At&T Outage Today 2022 Map
Jordan Poyer Wiki
kvoa.com | News 4 Tucson
Cornedbeefapproved
Sinai Sdn 2023
Kelley Fliehler Wikipedia
Willys Pickup For Sale Craigslist
Otis Offender Michigan
Stolen Touches Neva Altaj Read Online Free
Www Craigslist Com Shreveport Louisiana
How to Watch the X Trilogy Starring Mia Goth in Chronological Order
Arcadia Lesson Plan | Day 4: Crossword Puzzle | GradeSaver
Tds Wifi Outage
Elgin Il Building Department
Hindilinks4U Bollywood Action Movies
Craigslist Tulsa Ok Farm And Garden
Cranston Sewer Tax
Barstool Sports Gif
412Doctors
Timothy Warren Cobb Obituary
Professors Helpers Abbreviation
Dontrell Nelson - 2016 - Football - University of Memphis Athletics
Copd Active Learning Template
Bonecrusher Upgrade Rs3
The 13 best home gym equipment and machines of 2023
Kidcheck Login
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 5797

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.