** How to Connect to an Amazon Linux EC2 Instance Using SSH** Secure Shell (SSH) is the standard method for remotely accessing Linux-based EC2 instances on AWS. Follow the steps below to securely connect to your Amazon Linux instance using an SSH client. Prerequisites Before connecting, ensure the following: Your EC2 instance is running and Amazon Linux is selected as the AMI. You have a .pem private key file downloaded during key pair creation. The instance's Security Group allows inbound SSH traffic (TCP port 22). The EC2 instance has a public IPv4 address or a public DNS name. Steps to SSH into Your EC2 Instance Open Terminal (Linux/macOS) or PowerShell (Windows) If you are on Windows and prefer a GUI, you can use PuTTY instead. Modify Permissions for the Private Key File `chmod 400 /path/to/your-key.pem` SSH into the EC2 Instance Use the default Amazon Linux user (ec2-user) and your instance's public DNS or IP: `ssh -i /path/to/your-key.pem ec2-user@<your-ec2-public-dns>` example `ssh -i ~/keys/my-ec2-key.pem ec2-user@ec2-54-202-123-45.us-west-2.compute.amazonaws.com` Notes 1. If you're using EC2 Instance Connect, you can also connect via the AWS Console. 2. Ensure your key pair matches the instance. If you lose the private key, you cannot connect. 3. If you face a "Permission denied (publickey)" error, verify: Correct user (ec2-user for Amazon Linux) Correct permissions (chmod 400) Inbound SSH rule in Security Group