Dummy’s Guide to SSH into your AWS EC2 instance for Windows 10/11

Alicia Wong
2 min readJul 28, 2022

--

OpenSSH? PuTTy?

There’s an easier way using WSL (Windows Subsystem for Linux).

You should have already done these steps:

1. Start an instance
2. Create a key pair and download the .pem key

You’ll also need some information about your instance:
1. Your instance ID
2. Public DNS name of your instance
3. User name for your instance — this is something you may have already configured, or use the default user name.

Enable inbound traffic from your IP address to your instance.
Technically you can enable it from everywhere, but that’s not secure. Otherwise ensure that the security group associated with your instance allows incoming SSH traffic from your IP. You can change this by selecting the instance in your instance list, and going to the Security tab. Scroll down and you’ll see inbound rules.

Ready? Let’s go!

Connect to Linux instance using WSL
1. Open terminal window and use ssh command to connect to instance. If you’re using public DNS, then use your instance public DNS name. If you’re using IPv6, use your instance’s IPv6 address.

ssh -i /path/key-pair-name.pem instance-user-name@my-instance-public-dns-name

For example:

ssh -i C:/User/Downloads/supersecretkey.pem ec2-user@ec2–12–345–678–90.compute-1.amazonaws.com

2. A response will be returned:

The authenticity of host ‘ec2–54–211–172–20.compute-1.amazonaws.com (54.211.172.20)’ can’t be established.
ECDSA key fingerprint is SHA12345678901234567890.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

3. You can verify if the fingerprint in the security alert matches previous finger prints you’ve obtained.

4. Otherwise, enter yes to confirm. You’ll see another response return:

Warning: Permanently added ‘ec2–12–345–678–90.compute-1.amazonaws.com’ (ECDSA) to the list of known hosts.

Done!

That was much easier than you thought, right? :)

Hope this is useful to you!

--

--

Alicia Wong
Alicia Wong

Written by Alicia Wong

Pythonista. AWS Solutions Architect Associate. Fascinated by serverless, infrastructure as code, and cloud architecture.

No responses yet