How To Connect To Amazon AWS Via SSH?

368 Views
0 rating based on 0 reviews

Amazon Web Services paves the way to run cloud applications. And when we have to work with AWS components, sometimes we need to access the operating system shell for connecting hardware or for other administrative tasks. In this article, I will show you how to connect to Amazon AWS via SSH. It is useful not only from the developer's viewpoint, but also from a systems administrator's one. Let’s start!

Connect to Amazon AWS via SSH

Amazon Web Services (AWS) is an on-demand cloud computing platform that provides APIs for companies and professionals. By cloud computing, it means something like an analytics service. You can compute, use database storage, deliver contents, and use other features to scale & grow your business.

With Amazon AWS, you can run dynamic websites and web-based applications, store your files, business information, contact details, and many more. You can also manage databases like MySQL, Oracle, PostgreSQL, or SQL Server to store information.

On the other hand, SSH or Secure Shell is a type of network that sets up communication between two computers and allows the users to share data. SSH works as a distant administrative protocol that lets users control and alter remote servers. It also serves as a secure alternative to service protocols without protection.

So how to connect these two? How to control Amazon AWS via SSH?

To perform such a measure, we’ll need AWS EC2 instances. Let’s find out how to set up the connections.

What is Amazon AWS EC2?

Amazon EC2 or Amazon Elastic Compute Cloud is a web service that ensures a resizable & secure cloud-based compute capacity. It can easily make cloud computing easier on a web-scale for developers.

Amazon EC2 has a simple web service interface that allows you to find and adjust capacity with minimal friction. It gives you complete control of your resources for computing, letting you run on Amazon’s verified computing network.

Amazon EC2

Before you get started

You need to take care of a few things beforehand.

Once you have your AWS instance set-up, you need to create an SSH key file. Because later on, we’ll need it to connect AWS via SSH.

Connect Amazon AWS via SSH with EC2

First of all, you’ll need an associate client to set up the connection. So follow the instructions.

  1. Download Putty, an associate client. Click this link to go to the download page.
  2. After the download is complete, install and open up the Putty key generator.
    to Putty key generator
  3. Click on “Load”. It’ll open a Windows Explorer window. Now locate the SSH file you saved earlier. It’ll be a key file with a .pem format. Select it and hit “Load”.
    Load a private key
  4. Once successfully loaded, you’ll see the following screen.
  5. Click on “Save private key” and select a place on your device to save the file. It’ll save with a.PPK extension. So what Putty does is convert a.PEM file to a.PPK format for AWS to use.Save private key
  6. Go to your AWS account. From Dashboard under the “Compute” tab, select EC2.AWS account
  7. Go to “Instances” from the new window. From there, copy your public DNS number as shown below.public DNS number
  8. Open “Putty Configuration”. You’ll find a field for a host name on the start tab. Input your hostname and paste the public DNS you just copied. See the image below.
    hostname from Putty configuration
  9. Now, from the vertical menu on the left, go to SSH -> Auth and click on browse.vertical menu on the left
  10. Locate the PPK file you saved earlier and click to load. Go back to the Session menu back on top and click “Open”. You’ll be prompted with a window asking for permission. Click yes.

And there you go! You now have successfully set up a connection between your Amazon AWS and SSH using EC2. You’ll see a confirmation command prompt as well. Time to get started!

Summary: Connect to Amazon AWS via SSH

  • Create an EC2 instance.
  • Create a new key pair.
  • Translate the pem key to a ppk key.
  • Start your EC2 Instance.
  • Connect to your EC2 instance via SSH.