Log into the EC2 instance | Thorn Technologies

Log into the EC2 instance

Here are instructions on how to log into the EC2 instance on both Linux/Mac and Windows.

Linux / Mac instructions

From your local machine, run the following commands:

LocalMac:mykeys localuser$ chmod 600 MyPrivateKey.pem
LocalMac:mykeys localuser$ ssh -i MyPrivateKey.pem ec2-user@<public ip>
  1. MyPrivateKey.pem: Locate the directory containing your private key, which you downloaded when creating your Key Pair.
  2. chmod: SSH requires strict access on the private key.
  3. ssh: You log into the server using the private key as the identity (-i)

Windows instructions (PuTTY)

PuTTY does not natively support the PEM format that AWS uses, so you need to first convert your .PEM file to a PuTTY Private Key file (.PPK). To do this, you use the PuTTYgen utility packaged with PuTTY.

putty1-half.jpg

  1. Open PuTTYgen and click Load to browse for your .PEM key. When browsing for the key, be sure to select All Files in the dropdown menu. Click Open when you have selected your key.
  2. PuTTYgen will now convert your key to the proper filetype.
  3. To save your new PPK key, click Save private key.

You are now ready to SSH in to the server with PuTTY using the new .PPK key.

putty2-half.jpg

  1. Open PuTTY and select SSH as the connection type.
  2. In the Host Name field, enter ec2-user@<public ip>
  3. Expand the SSH section on the left, and click on Auth.
  4. Click on Browse to browse for the .PPK key, and click Open when you have selected it.
  5. To launch the SSH session, click Open.