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.

Similar articles