How to SHH into an AWS EC2 instance?
Feb 1, 2025 at 17:00 pm
The SSH protocol is a network protocol operating network services securely over an unsecured network. In simple terms, it's used to connect to remote machine.
While creating an EC2 instance, keep in mind to download key pair in .pem file. The key value pair will be required to connect to the remote EC2 instance from your terminal.
The following commands will work only for EC2 with Ubuntu installed.
Step 1: Remove write and execute permissions from Instance.pem file.
chmod 400 Instance2.pem Now, copy the public IPv4 address of the EC2 instance from the AWS console.
Step 2: SSH into the remote instance by running the following command.
ssh -i Instance2.pem ubuntu@13.60.34.250Alternatively you can also use the public IPv4 DNS assigned to the instance.
ssh -i Instance2.pem ubuntu@ec2-13-60-34-250.eu-north-1.compute.amazonaws.comAnd you are in :
