Nov. 29, 2024, 10:14 a.m.  |     132     0         0

Connecting to an Amazon EC2 Instance Using PuTTY

 

Introduction

This guide will walk you through the steps of connecting to your Amazon Elastic Compute Cloud (EC2) instance using PuTTY, a free SSH and telnet client. This is a common method for remote access and administration of your EC2 instances.

Prerequisites

  • Amazon Web Services (AWS) Account: You need an AWS account to create and manage EC2 instances.
  • PuTTY: Download and install PuTTY from the official website: https://www.putty.org/
  • EC2 Instance: An EC2 instance running a Linux-based operating system like Amazon Linux, Ubuntu, or CentOS.
  • Security Group Configuration: Ensure your EC2 instance's security group allows inbound SSH traffic on port 22 from your IP address or a specific IP range.

Assumptions

This guide assumes that the reader knows the following:

  • How to create Amazon EC2 instances.
  • How to configure security groups on EC2 instances.

Steps

  1. Generate a Key Pair:
    • Log in to the AWS Management Console.
    • Navigate to the EC2 service.
    • In the navigation pane, under Network & Security, choose Key Pairs.

 

  • Click Create key pair

 

  • Enter a name for the key pair > select RSA for key pair type > select .ppk and click Create key pair.

 

  • Download the private key file (.pem) and save it securely. This key pair  used to authenticate your connection to the EC2 instance via.
  1. PEM to PPK Conversion (Optional): If you generated a PEM key file format or this is the key format shared with you to allow you access an EC2 instance then you have to convert the Key from the PEM format to a PPK format in order to use it on PuTTY Follow the steps below:
    • Open the PuTTYgen tool (this comes along with a PuTTY installation so for windows users simply enter the name ‘PuTTYgen’ on your search bar and open the application)
    • Select RSA as the type of key to generate then click on "Load," 

 

 

  • Select your .PEM file and optionally provide a key phrase for additional security then click on save private key. Now you have a valid PPK key!
  1. Configure PuTTY:
    • Open PuTTY.
    • In the Session category, enter the public DNS name or IP address of your EC2 instance in the "Host Name" field.

 

  • Under Connection > SSH > Auth > Select Credentials

  • Unser Private key file for authentication select browse and pick the .PPK file we generated previously.

 

  • Click "Open" to start the connection.
  • Click on Accept

  • You will now be connected to your EC2 instance!

 

Additional Tips:

  • Security Best Practices: 
    • Store your private key securely.
    • Avoid sharing your private key with others.
    • Use strong passwords.
    • Keep your EC2 instance's software up-to-date.
    • Regularly review and update your security group rules.
  • PuTTY Configuration: 
    • You can save your PuTTY session settings for future use.
    • Customize PuTTY's appearance and behaviour to your preferences.

By following these steps and considering the security best practices, you can effectively connect to your EC2 instance using PuTTY and manage it remotely.

Comments

Sign in to add to the conversation