🚀 Step 1: Verify SSH is Installed
On Windows 10, SSH is built-in — but let’s confirm.
Open Windows PowerShell or Command Prompt
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
lsYou should see or Rename it to this:
EC2Tutorial.pem✔ This is the key file you downloaded from AWS.
💡 Tip: Only the
.pemfile is needed for SSH (ignore.ppkunless 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), ORYour 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.xxxWhat this means:
i EC2Tutorial.pem→ your private keyec2-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-userping google.com👉 Press Ctrl + C to stop
🚪 Step 8: Exit the Instance
To disconnect:
exitOR
Ctrl + D⚠️ Troubleshooting: Permission Issues
If you get an error like:
Permissions are too openFix it:
Right-click
.pemfile → PropertiesGo to Security tab
Click Advanced
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-ipFix permissions if needed
Once connected → you control your EC2 via command line