Thursday, September 22, 2016

How to connect to AWS from Mac using SSH

Follow the steps to connect to AWS from Mac

- Find the full path of the .PEM file which has the private key (You must have got it while creating the the aws instance)
- Open the Mac Terminal and execute the following command.

ssh -i /home/user1/.ssh/aws.pem root@aws_instance_ip

Note:
If you have already used a .PPK file in your windows system then follow the steps below to generate the .PEM file.

- Check if puttygen is installed

$ puttygen --version

puttygen: Release 0.67

- If puttygen is not installed then install putty using brew.
puttygen will come with putty.

  * Install Ruby in your Mac box.
  * Run the following command :

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  <More info on brew from http://brew.sh/ site>

  Once brew is installed, install putty

  $ brew install putty

- Check if puttygen is installed

$ puttygen --version

puttygen: Release 0.67

- Output the data from .PPK file to .PEM file using puttygen

$ puttygen aws.ppk -0 private-openssh -o aws.pem

Once you generated the .PEM file connect to aws instance using ssh.
ssh -i /home/user1/.ssh/aws.pem root@aws_instance_ip

No comments:

Post a Comment