AWS Certified Cloud Practitioner / EC2 - Elastic Compute Cloud

How to SSH using Windows 10

🚀 Step 1: Verify SSH is Installed

On Windows 10, SSH is built-in — but let’s confirm.

  1. Open Windows PowerShell or Command Prompt

  2. Type:

ssh

✅ If SSH is installed:

You’ll see a list of SSH command options.

❌ If NOT installed:

You won’t see anything useful → in that case, use PuTTY (covered in the previous lecture).


📁 Step 2: Navigate to Your Key Pair (.pem file)

Before connecting, you must be in the same directory as your .pem file. (Downloaded during ec2 setup)

Example:

cd Desktop
ls

You should see or Rename it to this:

EC2Tutorial.pem

✔ This is the key file you downloaded from AWS.

💡 Tip: Only the .pem file is needed for SSH (ignore .ppk unless using PuTTY)


🔐 Step 3: Ensure Security Group Allows SSH

Before connecting, confirm:

  • Port 22 (SSH) is open in your Security Group

  • Source is:

    • 0.0.0.0/0 (for testing), OR

    • Your IP (more secure)


💻 Step 4: Run the SSH Command

Now we connect to the EC2 instance.

Command format:

ssh -i EC2Tutorial.pem ec2-user@<your-public-ip>

Example:

ssh -i EC2Tutorial.pem ec2-user@3.250.xxx.xxx

What this means:

  • i EC2Tutorial.pem → your private key

  • ec2-user → default user for Amazon Linux

  • @<IP> → your EC2 public IPv4 address


⚠️ Step 5: Accept Security Prompt

First time connecting, you’ll see:

The authenticity of host can't be established...
Are you sure you want to continue?

👉 Type:

yes

🎉 Step 6: You’re Connected!

If successful, you’ll see something like:

[ec2-user@ip-xxx-xxx-xxx-xxx ~]$

✅ You are now inside your EC2 instance!


🧪 Step 7: Test Commands

Try a few basic commands:

whoami

👉 Output:

ec2-user
ping google.com

👉 Press Ctrl + C to stop


🚪 Step 8: Exit the Instance

To disconnect:

exit

OR

Ctrl + D

⚠️ Troubleshooting: Permission Issues

If you get an error like:

Permissions are too open

Fix it:

  1. Right-click .pem file → Properties

  2. Go to Security tab

  3. Click Advanced

  4. Do the following:

🔧 Fix Permissions:

  • Change Owner → your Windows user

  • Click Disable inheritance

  • Remove all users except yourself

  • Give yourself Full Control

✔ After this, retry the SSH command — it will work.


🧠 Key Things to Remember

✔ Always be in the correct folder

✔ Always use the correct .pem file

✔ Always check port 22 is open

✔ Public IP may change if instance restarts


✅ Final Summary

  • Windows 10 supports SSH natively (no PuTTY required)

  • Use:

ssh -i key.pem ec2-user@public-ip
  • Fix permissions if needed

  • Once connected → you control your EC2 via command line