Monday, May 6, 2019

How to connect to an EC2 instance from Windows or IMac?


1. SSH keys(for e.g., myEc2Jenkins.pem) already downloaded in your local machine, preferably in downloads folder.
2. Your EC2 instance is up and running in AWS
3. For windows laptop, you need to use Git bash. You can install Git by downloading from this URL -

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"

For windows machine(and also for iMac))

1. Open Git bash
2. type pwd
It may print your directory in git bash
3. Now type cd downloads
4. make sure you have keys in the downloads directory by typing the below command:
  dir  *.pem

The above command should list all the pem files in the downloads directory.

only for Macbook pro laptops, you need to perform additional step
chmod 400 myJenkinsEc2KKey.pem

5. Now paste the url from step # 4 above
ssh -i "mykey.pem"
type yes

6. now you should be in AWS cloud, screen should tell you something like this:

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

1 comment:

Create Freestyle job in Jenkins | How to create build job in Jenkins to automate Java build and deployment of WAR into Tomcat | Bitbucket Jenkins Integration

Jenkins is popular open source Continuous integration tool. It was written entirely in Java. Jenkins is a self-contained automation server u...