SSH into EC2 Instance

For MAC Users

  1. Open Terminal

  2. Navigate to the location where .pem key is downloaded and stored in your local.

  3. To update Permissions, run command

    • chmod 400 keypairname.pem

  4. To SSH and connect to the EC2 Instance, Enter the following command:

    • Syntax: ssh -i keypairname.pem [email protected] (enter the public IP address)

    • Sample: ssh -i keypairname.pem [email protected]  - Click Enter

    • Up next, type yes and Enter, you will be successfully logged into EC2 Instance.

For Windows Users 

  1. Download putty and puttygen from this link : https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

  2. To convert your key pair .pem to .ppk:

    • Open .

    • Click on .

    • Click on All files to show your .pem file and select the .pem file.

    • You will get a success message if done correctly.

  • Click on Save Private Key.
  • Enter keypairname and Save.

  • keypairname.ppk file will be saved to your local machine.

  1. Navigate to the EC2 instance page and get the public IP of the machine.

  2. Open 

    • Host Name    : Enter the public IP address

  • Click  , select  and click on  to select the private key (.ppk) that you converted from the .pem file.
  • Click on .

?

  • Select  to connect to the machine.

  1. If you are using Linux AMI other than Ubuntu for the lab:

    • Enter user name: ec2-user and hit Enter.

  1. If you are using Ubuntu AMI for the lab:

    • Enter user name: ubuntu and hit Enter.

  2. You will see the console after a successful login.