Launch EC2 Instance With Existing Key Pair : A Step-By-Step Guide
After launching the EC2 Instance, we are going to the EC2 Instance with Putty Method. So make sure that putty is available in your local system.
Step 1: Navigate To EC2
- Login in into AWS Account and your credentials of username and password.
- After login in, you will be landed into the Console Home, from the console home navigate to the EC2 Page.
Step 2: Launch Instance
- After once landing on the EC2 page, in the running instances section, Click on Launch Instance button for creating new instance.
Step 3: Define The Instance
- Define the parameters in the page such as Name as “my_aws_instance” and number of instances as “1”
- Choose the AMI as “Amazon Linux 2” as shown in below screenshot.
- Choose the instance type”t2.micro”
Step 4: Choose Existing Key Pair
- Now, here select the key pair that we created in the above implementation. The below screenshot helps in getting it clear.
Step 5: Review And Launch Instance
- After once defining the Values and specifications create the instance by clicking on the Launch Instance.
- It will take some time for creating the instance and take some more time for get into running state.
Step 6: Connect To Instance
- As shown in the below screenshot, choose the created instance and go for connecting it by clicking on the connect button. It helps in knowing the IP address and Instance username “ec2-user”
Step 7: Open Putty In Setup
- Now, you needed putty software to connect to the instance, if you don’t have download it from browser as per your system specifications as x64 or amd architecture.
- Click on the putty software and making it running.
Step 8: Provide Credentials
- Now, provide the credentials regarding the instance such as “hostname or IP”. The following screenshot specifies clearly about specifying the IP address of my instance.
- Provide the private key to the ec2-instance, for this navigate to SSH and go to Auth and then click on Credentials path. The below screenshot illustrates it clearly for you.
- Click on the browser beside the first dialog and then navigate to your file system where the downloaded private key with mykeypair.ppk file located and provide to it.
- After providing the private file and click on open button.
- Browse to the file system where the private key is available and open the file as shown in the following screenshot.
Step 9: Connect To EC2 Instance
- Click on the Accept button and then in the black console screen it will ask for login in user name specify it as ec2-user
Step 10: Success Remote Login
- After providing the username as ec2-user, you will the black screenshot as shown in the below screenshot of successful connecting to the instance “my_aws_instance” with remote mode.
How To A Create A Key Pairs In AWS-EC2 ? |Complete Tutorial
In Amazon Web Services, an EC2 key pair consists of a public key and a private key that is used to securely communicate with EC2 instances. The public key is stored on the EC2 instance and is used to encrypt messages that can only be decrypted by the corresponding private key, which is kept by the user who generated the key pair. The private key is used to decrypt messages that have been encrypted with the public key.