Need help?

Our experts have had an average response time of 13.52 minutes in October 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Replace a lost key pair for EC2 Windows- How to fix

by | Aug 17, 2021

Wondering how to replace a lost key pair for EC2 Windows? We can help you!

As a part of our AWS Support services, we often receive similar queries from our AWS Customers.

Today, let’s see how our Support Engineers help our customers to replace a lost key pair for EC2 Windows.

 

Replace a lost key pair for EC2 Windows

 
Amazon EC2 uses a set of key pairs that is a public key and a private key to prove our identity when we connect to an EC2 instance. If we lost a  key pair and want to replace it, we can create an AMI of the existing instance, launch a new instance and then select a new key pair.

We can also retrieve the lost key pair by using the AWSSupport-ResetAccess document if our instance is a managed instance in the AWS Systems Manager.
 

Creating an AMI and launching a new instance

 
If we lost an administrator password, we must use its key pair when resetting the password using EC2Config or EC2Launch. But if we lost the key pair, we need to create an AMI of the existing instance, launch a new instance, and then select a new key pair.
 

Steps for creating an AMI, launching a new instance, and then selecting new key pair

 

  1. At first, we need to create a new private key pair using the console, the AWS CLI, or AWS Tools for Windows PowerShell, and then save it in a safe area.

2. Log in to the Amazon EC2 console and select Instances and then select our instance.

3. Then note the Instance type, VPC ID, Subnet ID, Security groups, and IAM role for the instance from the Description tab.

4. Now stop the instance. If your instance is instance store-backed or has instance store volumes containing data, the data is lost when you stop the instance.

5. Select the instance and then select Image > Create Image for Actions.

6. Enter a name for Image name and click Create Image, and then select Close.

7.  Select AMI to see the status. If the status is pending, the AMI is being created. Continue to the next step when the status becomes available.

8. Then select the AMI and then select Launch.

9. Then complete the wizard. Also make sure to select the same instance type, VPC ID, Subnet ID, Security groups, and IAM role as the instance we are replacing.

10. Select the new key pair for Select a key pair.

11. Also associate the Elastic IP address to the new instance, if the old instance has an associated Elastic IP address.

12. If any Amazon EBS volumes are not captured during the AMI creation, detach the volume, and then attach the volume to the new instance. Note that we can skip the step to unmount volume as the original instance is already stopped.

13. The private key file is now replaced and we can reset the administrator password.

14. We can also terminate the original instance for which the key pair is lost(optional).
 

Using the AWSSupport-ResetAccess document

 
We can use the  AWSSupport-ResetAccess Automation document if our instance is a managed instance in the AWS Systems Manager to replace a lost key pair or to replace a lost local Administrator password.

[Need help with more AWS queries? We’d be happy to assist]
 

Conclusion

 
To conclude, today we saw the steps followed by our Support Engineers to help our customers to replace a lost key pair for EC2 Windows.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Reviews

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF