3.18 SSH over Windows10 AWS

In this lesson we connect to an EC2 Linux instance directly from Windows 10, without PuTTY. Recent versions of Windows 10 ship with the OpenSSH client built into PowerShell and the Command Prompt. To check, type ssh in either shell — if it returns the standard help, OpenSSH is installed. If not, follow the PuTTY procedure from the previous lesson.

Building the SSH command

  • Right-click your .pem file, open the properties, and copy its full path.
  • Build the command: ssh -i C:\path\to\my-key.pem ec2-user@<public-ip>.
  • Accept the host fingerprint on first connection by typing yes.

At first you will likely get a warning that the private key is unprotected and the connection is refused. On Linux/macOS this is fixed with chmod 400, but Windows uses NTFS ACLs instead. Right-click the .pem file, open Properties > Security > Advanced, then disable inheritance and choose to remove all inherited permissions. Make sure only your current user remains in the access list with full control, then remove every other entry (Administrators, SYSTEM, Authenticated Users). The file is now tight enough for OpenSSH to accept it.

Run the ssh command again — this time you log in successfully to your Amazon EC2 instance. From there you can execute any Linux command: whoami, uname -a, ping google.com to validate connectivity. The same command works identically from PowerShell and from CMD. You now know how to reach an AWS EC2 server from Windows 10 using only native tooling.

Summary

This lesson teaches how to connect to an AWS EC2 instance from Windows 10 using SSH and PowerShell. SSH is the essential tool for secure remote machine control over the internet. The lesson covers testing SSH availability in PowerShell, configuring the SSH command with a private key certificate and the default EC2 user (ec2-user), and importantly, resolving file permission issues on Windows through NTFS security settings (since chmod does not exist on Windows), ultimately enabling successful connection to the EC2 instance.

Key points

  • SSH is the primary tool for secure remote connection to AWS EC2 instances over the internet
  • Windows 10 has SSH pre-installed and can be tested via PowerShell with the 'ssh' command
  • SSH connection requires three components: the private key certificate, the EC2 instance IP address, and the default EC2 user (ec2-user)
  • Windows uses NTFS file permissions instead of chmod; configure the private key file's security settings to restrict access appropriately
  • On first connection, confirm the connection by typing 'yes' when prompted
  • If key permissions are not correct, the SSH connection will fail; proper NTFS permissions (disable inheritance, set ownership, remove other user access) are essential

FAQ

What is the default user for AWS EC2 instances?

The default user for EC2 instances is 'ec2-user'.

Can I use chmod on Windows to fix SSH key permissions?

No, chmod does not exist on Windows. Instead, use NTFS file security settings (right-click the key file, select Properties, go to Security tab) to modify permissions, disable inheritance, and ensure only the current user has access.

What should I do if SSH is not available on my Windows machine?

You can install SSH or use alternative tools like PuTTY to connect to your EC2 instance.