πŸ’» Connect To EC2 Instance In Windows 10 Via SSH

Introduction

In this article, I'll describe step-by-step how to connect to your EC2 instances from a Windows 10 machine via SSH, without downloading a third-party SSH client.

Adding the OpenSSH Client

First, we must make sure we have the OpenSSH Client installed. We can check first.

  • Press Win + S and type "Settings"
    SSH
  • In the search box, type "apps" and select Apps & Features
    Apps
  • In the next screen, under the "Apps & features" tab, click on "Optional Features"
    Apps & features
  • In this next screen, scroll down to look for "OpenSSH Client." (If it appears in this list, you already have it installed and you can feel free to skip the rest of these steps)
    OpenSSH Client
  • If it's not installed already, scroll back to the top and click "Add a feature."
    Add a feature
  • Scroll until you find "OpenSSH Client" and install it.

Now that we have the Microsoft OpenSSH client installed on our machine, we can begin connecting to our EC2 instance from any terminal.

In the AWS Console

  1. Navigate to EC2 and click on "Instances"
  2. Select the EC2 instance you'd like to SSH to

We need the "Public IPv4 DNS".

 DNS

Now navigate to the folder where your .pemkey file is saved, and open a command prompt in that folder.

Note. I'll show you a neat way to open a command prompt in Windows 10 if you aren't aware of this hidden feature

Once you've navigated to the appropriate folder in File Explorer, left-click the folder icon to the left of the address bar and type "cmd" before the address of the folder.

File Explorer

Documents

Then press Enter. It should launch a command prompt window navigated to the current folder.

We're almost finished. Now all we have to do is type the following command into the command prompt.

ssh -i "my_key.pem" ec2-user@YOUR_IPv4_DNS_URL

If your key has a password, it should prompt you to enter this information.

Now you should be successfully connected to your EC2 instance.

EC2

Summary

In this guide, we learned how we can install a first-party SSH client in Windows 10 and then use it to connect to our AWS EC2 instance. Hopefully, this guide has been helpful.

If there are any issues feel free to leave a comment and I'll do my best to help.

Stay safe and happy developing!


Similar Articles