This lab walks you through the steps to SSH into EC2 Instance whose Key pair is lost.
You will practice using Amazon Machine Images to launch Amazon EC2 Instances and use key pairs for SSH authentication to log into your instance. Then create a temporary instance with a new key pair and transfer the key pair data to the first instance and SSH into that instance using this instance's key pair.
Duration: 90 minutes
AWS Region: US East (N. Virginia) us-east-1
AWS defines it as Elastic Compute Cloud.
It’s a virtual environment where “you rent” to have your environment created, without purchasing.
Amazon refers to these virtual machines as Instances.
Preconfigured templates can be used to launch instances. These templates are referred to as images. Amazon provides these images in the form of AMIs (Amazon Machine Images).
Allows you to install custom applications and services.
Scaling of infrastructure i.e., up or down is easy based on the demand you face.
AWS provides multiple configurations of CPU, memory, storage etc., through which you can pick the flavor that's required for your environment.
Key Pair consists of a public and private key, which is a set of security credentials that we use to prove our identity when connecting to an instance. Amazon EC2 stores the public key, and you store the private key. Instead of a password, you will be using a private key to securely access the instance. Ownership of private key security is with the customer. So, he/she has to be careful in handling it.
ABC Corporation is a software company that is new to working with AWS. They had launched a group of PoC servers and had defined a Key pair to login into the servers. Since they are new, and due to some unknown reasons they had lost the key pair file. They have a customer visit scheduled and are required to demonstrate the PoC. Now, how do they get to the server and have the PoC presented? We have got multiple ways to get this issue resolved, And one of the ways you will see with this lab.
Launching Lab Environment
Launching an EC2 Instance
Stop the Original_Instance
Launch a temporary instance
Detach the root volume of the first instance and attach it to the temporary instance
Add the new public key information to the Original instance
Unmount and detach the temporary volume and attach to the Original instance
SSH into Original_instance using new key pair
Delete the AWS Resources