How to connect to an EC2 instance from Windows or Mac
Pre-requistes:
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 - https://git-scm.com/downloads
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" ubuntu@dns_name.compute.amazonaws.com

For windows machine(and also for Mac))
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:
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 - https://git-scm.com/downloads
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" ubuntu@dns_name.compute.amazonaws.com

For windows machine(and also for Mac))
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:
ls *.pem
The above command should list all the pem files in the downloads directory.
Note: Only for Macbook pro laptops!
The above command should list all the pem files in the downloads directory.
Note: Only for Macbook pro laptops!
You need to perform additional step to give read permissions for the *.pem file
chmod 400 myJenkinsEc2KKey.pem.
chmod 400 myJenkinsEc2KKey.pem.


No comments:
Post a Comment