Thursday, October 24, 2019

How to connect to an EC2 instance from local machine after creating EC2 in AWS?

Find the steps to connect to an EC2 instance from local machine after creating it in AWS.


1. Keys(for e.g., yourkey.pem) already downloaded in your local machine, preferably in Downloads folder.
2. EC2 is up and running
3. For windows laptop, you need to install Git by downloading from this URL -
4. For apple desktop or laptops, download

Steps to connect to EC2 instance:

1. Go to AWS console.
2. Click on EC2, click on running instances link

3. Select the checkbox of EC2 you would like to connect to.
4. Click on Action. Copy the url from SSH which looks like below:
For e.g.
ssh -i "mykey.pem"

5. Go to your local machine, Open Git bash, navigate to downloads directory like below:
For windows laptop --> cd downloads

steps For iMac only --> cd downloads
chmod 400 yourkey.pem

6. Paste the url from example highlighted above in step # 4.
ssh -i "mykey.pem"
7. say yes when it is asking to connect.
8. now you should be in AWS cloud, screen should tell you something like this:

Last login: Sun Feb 18 19:01:21 2018 from

No comments:

Post a Comment

How to create Pull Request (PR) templates in Github repository | Creating a pull request template for your GitHub repository

Creating pull request (PR) templates in GitHub can help streamline the process of submitting PRs by providing a predefined structure. Thi...