💻 Connect To EC2 Instance In Windows 10 Via SSH

Introduction

 
In this article I'll decsribe 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 by first,
  • Press Win + S and type "Settings"
SSH To An AWS EC2 Instance In Windows 10
  • In the search box, type "apps" and select Apps & Features
SSH To An AWS EC2 Instance In Windows 10
  • In the next screen, under the "Apps & features" tab, click on "Optional Features"
SSH To An AWS EC2 Instance In Windows 10 
  • 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)
SSH To An AWS EC2 Instance In Windows 10
  • If it's not installed already, scroll back to the top and click "Add a feature."
SSH To An AWS EC2 Instance In Windows 10 
  • 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"
 
SSH To An AWS EC2 Instance In Windows 10
 
Now navigate to the folder where your .pem key 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 the File Explorer, left click the folder icon to the left of the address bar and type "cmd" before the adress of the folder.
 
SSH To An AWS EC2 Instance In Windows 10
 
SSH To An AWS EC2 Instance In Windows 10
 
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!
 
SSH To An AWS EC2 Instance In Windows 10

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!