Lecture 02 – CONNECT EC2 USING CLI

CONNECT EC2 USING CLI

hands-on_image

What Is CLI?

a Command Line Interface Connects a User to a Computer Program or Operating System. Through the CLI, Users Interact with a System or Application by Typing in Text (commands). The Command is Typed on a Specific Line Following a Visual Prompt From The Computer.

Pre-Requisites:

  1. Keys ( 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 GITBASH | For Macbook Pro or iMac OS, You need to install iTERM2

Steps to connect to EC2 Instance

Step 01: Go to AWS Console and click on instances

Step 02: Select the checkbox of EC2 you would like to connect and Click on Connect button.

Step 03: Go to your local system, Open CLI terminal and navigate to downloads directory.
RUN –> $ cd Downloads and press ENTER
Step 04: Go back to your AWS console. Hover and click on SSH client tab, –> Copy the EC2 Chmod 400 MyDevops-Key.pem as shown below and paste on your CLI terminal and press ENTER
 
Note: This step will only be performed just for one time and the first time connecting to the Ec2
Step 05: Copy EXAMPLE: ssh URL and paste on CLI terminal and press ENTER

Step 06: Type yes when it is asking to connect. 

Press ENTER

Your terminal screen should show something like below.

It means you are successfully connected to EC2 instance running on AWS cloud.