AWS Solutions Architect · Module 3 · Day 10
Launch & Access a Linux EC2 Instance
Most servers in the cloud run Linux, so this is the method you will use most. You will launch a Linux instance and log in with SSH, using whichever tool fits your laptop. Then you will learn to fix the four SSH errors every beginner meets.
In this session
- Linux EC2 at a glance: SSH, port 22, ec2-user/ubuntu
- Lab: launch a Linux instance
- Five ways to connect
- Reading the ssh command
- Fixing common SSH errors
- Safer access: Session Manager
01Linux EC2 at a glance
| Item | Value |
|---|---|
| AMI | Amazon Linux 2023 or Ubuntu |
| Username | ec2-user (Amazon Linux, RHEL) · ubuntu (Ubuntu) |
| Connection | SSH (Secure Shell), port 22 |
| Login proof | your private key (.pem or .ppk), no password |
| Users at once | many users can log in at the same time |
📞
SSH is a secure phone line into the server. Instead of a desktop (RDP), you get a text window where you type commands.
Note: every Linux system has a root user, but on EC2 you never log in as root directly. You log in as ec2-user/ubuntu and use
sudo (Day 11).02Lab: launch a Linux instance
Demo · Do it yourself
03Five ways to connect
Demo · Pick your tool
04Fixing common SSH errors
Demo · What does the error mean?
- Port 22 open to the world is attacked by bots all day. Restrict it to My IP.
- Best practice in companies: Systems Manager Session Manager (no port 22, no key pair, no public IP, every session logged) or EC2 Instance Connect Endpoint for private subnets.
- Never share .pem files in chat or email, and never commit them to Git.
🎯 Exam corner
- Linux → SSH, port 22, key pair.
- No SSH keys, no bastion, audited sessions → Session Manager.
- Reach an instance in a private subnet without a public IP → Session Manager or EC2 Instance Connect Endpoint.
05Summary
- Linux EC2: SSH, port 22, user
ec2-userorubuntu, private key instead of a password. - Connect from the browser, CMD/PowerShell, a Linux/Mac terminal, MobaXterm (.pem) or PuTTY (.ppk).
ssh -i key.pem user@public-ip; protect the key withchmod 400.- Timeouts = security group; “publickey” = wrong user or key.
- Production: Session Manager instead of open port 22.
06Quick quiz
1. Default user on Amazon Linux?
2. Correct SSH command?
3. Which format does PuTTY need?
4. “Permission denied (publickey)” usually means…
5. Which service gives shell access with no port 22 and no keys?
07References
Created by Ajeetkumar