How to SSH into an AWS EC2 Instance

Updated on
December 22, 2024
read
No items found.
Pros:
Cons:

Step: 1

Start by launching an EC2 instance in the AWS Management Console, ensuring you select the appropriate key pair for SSH access.

Step: 2

If you haven't already, download the private key file (.pem) associated with your key pair and save it securely.

Step: 3

Open your terminal and run the command chmod 400 /path/to/your-key.pem to set the correct permissions for your key file.

Step: 4

In the EC2 dashboard, locate your instance and note its public IPv4 address or public DNS name.

Step: 5

Use the terminal to connect to your instance with the command ssh -i /path/to/your-key.pem ec2-user@your-instance-public-ip, replacing the path and IP address accordingly.

Step: 6

If prompted, type "yes" to confirm the connection, and you should be logged into your EC2 instance.

Set up
Instant access with SSO in just 4 hours!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Unify Legacy and Modern Apps With an IAM That Simplifies Access Control.

Enter the future of digital security.

Experience AI-enhanced IAM capabilities and better security.
Checkmark
Reusable identity
Checkmark
Zero-Knowledge Proofs
Checkmark
Zero Trust practices
Checkmark
AI Agents