How to Connect to EC2 with SSH PuTTY?

How to Connect to EC2 with SSH PuTTY

Amazon Elastic Compute Cloud (EC2) is a popular cloud computing platform that enables users to rent virtual servers, known as instances, on demand. Once you have launched an EC2 instance, you need to connect to it via Secure Shell (SSH) to access the command line interface (CLI) and configure your applications. In this article, we will guide you through the process of connecting to EC2 with SSH PuTTY.

Step 1: Create an EC2 Instance

Before you can connect to an EC2 instance, you need to create one. Here are the steps to follow:

  1. Log in to the AWS Management Console.
  2. Navigate to the EC2 dashboard.
  3. Click the Launch Instance button to launch the instance wizard.
  4. Select an Amazon Machine Image (AMI) and choose the instance type.
  5. Configure the instance details, such as the network settings, storage, and security groups.
  6. Review your configuration and launch the instance.

Step 2: Download and Install PuTTY

PuTTY is a free, open-source SSH client that you can use to connect to your EC2 instance. To download and install PuTTY, follow these steps:

  1. Go to the official PuTTY website and download the latest version of the software.
  2. Run the installer and follow the on-screen instructions to complete the installation.

Step 3: Connect to Your EC2 Instance with PuTTY

Once you have created your EC2 instance and installed PuTTY, you can connect to your instance with SSH. Here are the steps to follow:

  1. Open PuTTY.
  2. In the Host Name field, enter the public IP address of your EC2 instance. You can find this on the EC2 dashboard in the Public IPv4 address column.
  3. In the Port field, enter 22, which is the default SSH port.
  4. Under the Connection type section, select SSH.
  5. In the Category section, expand the SSH subcategory and click on Auth.
  6. In the Authentication parameters section, click on the Browse button next to Private key file for authentication and navigate to the location where you saved your private key file.
  7. Click Open to connect to your EC2 instance.

Step 4: Use the CLI to Configure Your EC2 Instance

Once you have connected to your EC2 instance with PuTTY, you can use the CLI to configure your applications. Here are some useful commands:

  1. sudo apt-get update: Update the package lists on a Debian-based instance.
  2. sudo yum update: Update the package lists on a Red Hat-based instance.
  3. sudo apt-get install [package]: Install a package on a Debian-based instance.
  4. sudo yum install [package]: Install a package on a Red Hat-based instance.
  5. ssh [user]@[instance]: Connect to another EC2 instance via SSH.
  6. scp [file] [user]@[instance]: Copy a file from your local machine to an EC2 instance.
  7. scp [user]@[instance]:[file] [destination]: Copy a file from an EC2 instance to your local machine.

Connecting to EC2 with SSH PuTTY is a straightforward process that enables you to access your instance and configure your applications. By following the steps outlined in this article, you can get up and running quickly and easily.

Related Searches and Questions asked:

  • How to Connect SSH in AWS Linux?
  • How to Open SSH Port in EC2?
  • How Does SSH Work in AWS?
  • How to SSH into EC2 Using Linux?
  • That's it for this post. Keep practicing and have fun. Leave your comments if any.

    Post a Comment

    0 Comments