SSH (Secure Shell) is a critical tool for managing your Amazon EC2 instances remotely. It allows you to execute commands on your cloud server as if you were physically present. In this guide, we'll walk through setting up and using SSH on Mac or Linux to access an Amazon Linux 2 EC2 instance.
Before you begin, ensure you have:
✅ An Amazon EC2 instance running Amazon Linux 2.
✅ A .pem key file downloaded when you created your EC2 instance.
✅ A terminal (Mac Terminal or Linux command line).
✅ A public IPv4 address for your EC2 instance.
✅ Port 22 open in your EC2 Security Group (this allows SSH access).
To check if your EC2 instance allows SSH:
0.0.0.0/0 (or your specific IP for better security).