How to Connect to a Linux Instance on AWS from Another Linux Instance Using SSH

How to Connect to a Linux Instance on AWS from Another Linux Instance Using SSH

To access a Linux instance from a Windows instance on AWS, you can use an SSH client. So let's discuss what is SSH.

SSH(Secure Shell)

SSH(Secure Shell) is a network protocol that provides secure and encrypted communication over an unsecured network. It allows users to securely access and control remote servers and devices over the internet.

SSH provides a secure way to establish a connection between two devices, such as a client and a server, by encrypting the data transmitted between them. This makes it difficult for any unauthorized party to intercept or eavesdrop on the communication, ensuring that sensitive information remains protected.

Here are the steps to access a Linux instance from a Linux instance:

Step 1 -Create a Linux Instance in Amazon AWS.

As we can see that both instances are running successfully and make sure that both instances are running and are in the same Virtual Private Cloud (VPC) in AWS.

Step 2: Use SSH to Connect to Linux Instance.

To connect to the Linux instance using SSH open the Windows PowerShell or Command prompt or the applications that support SSH like putty.exe so to connect to an AWS instance using PuTTY, you need to follow these steps:

  1. Open Putty.exe and Enter the Host Name. You can use the Host Name of the instance (or IP address)

  2. Go to SSH -->AUTH --.CREDENTIALS & BROWSE THE PATH OF.PPK FILE.

  3. Click on the "Open" button to initiate the connection.

  4. If prompted, enter the username for the first instance you are connecting to

Step 3 :Use the SSH command in the terminal to connect to the other Linux instance.

The command should be in the following format:

ssh -i "mykey12.pem" ubuntu@ec2-3-109-62-109.ap-south-1.compute.amazonaws.com

Replace the " mykey12.pem " file with your .pem file & "username" with the username for the other Linux instance, and "public_ip_address" with the public IP address or hostname of the other Linux instance

AWS Connect to Linux instance with user and password - Austral Tech

Now you have successfully connected, you should be able to access and manage the other Linux instance from the command line.