Connecting to a Linux EC2 Instance Using Xshell on Windows: A Step-by-Step Guide

Connecting to a Linux EC2 Instance Using Xshell on Windows: A Step-by-Step Guide

ยท

2 min read

Introduction

Connecting to a Linux EC2 instance on AWS from a Windows machine can be accomplished using various tools. In this guide, we'll walk through the steps to connect to a Linux EC2 instance using Xshell, a powerful and user-friendly terminal emulator for Windows.


Prerequisites

Before we begin, ensure you have the following:

  • An active AWS account with a running Linux EC2 instance.

  • Xshell installed on your Windows machine.

  • The private key (.pem) file associated with your EC2 instance.


Step 1: Download and Install Xshell

If you haven't installed Xshell on your Windows machine, download and install it from the official website: NetSarang - Xshell.

Install the XShell 7 Free for Home/School version


Step 2: Open Xshell

After installing Xshell, open the application. You will be greeted with the Xshell home screen.


Step 3: Create a New Session

  1. Click on "File" in the top menu.

  2. Select "New Session" from the dropdown menu.


Step 4: Configure Session Settings

  1. Session Name:

    • Enter a name for your session (e.g. My Website).
  2. Protocol:

    • Choose "SSH" as the protocol.
  3. Host Address:

    • Enter the public IP address or public DNS of your EC2 instance.
  4. Port:

    • Set the port to 22, the default SSH port.

  5. User Authentication:

    • In the left sidebar, navigate to "User Authentication."

    • Choose "Public Key" as the authentication method.

  6. Select Private Key:

    • Click "Browse"

    • Then "Import" and select the private key (.pem) file associated with your EC2 instance.

  7. Save the Session:

    • Click "OK" to save your session settings.

Step 5: Connect to the EC2 Instance

  1. Back on the Xshell home screen, you should see your newly created session. Select it.

  2. Click "Open" to initiate the SSH connection.

  3. If prompted, confirm the security alert by clicking "Yes."

  4. If everything is configured correctly, you will be connected to your Linux EC2 instance via Xshell.


Conclusion

You have successfully connected to your Linux EC2 instance using Xshell on Windows.

Xshell provides a convenient and secure way to interact with your AWS resources from your Windows machine. Feel free to explore the terminal interface, execute commands, and manage your EC2 instance seamlessly.

ย