Click to Connect
button
There are 3 ways:
# use public IP
ssh -i developer-course-kp.pem [email protected]
# or use public DNS
ssh -i developer-course-kp.pem [email protected]
This is a security group issue. Any timeout (not just for SSH) is related to security groups or a firewall. Ensure your security group looks like this and correctly assigned to your EC2 instance.
You are using the wrong security key or not using a security key. Please look at your EC2 instance configuration to make sure you have assigned the correct key to it.
You are using the wrong user. Make sure you have started an Amazon Linux 2 EC2 instance, and make sure you're using the user ec2-user
. This is something you specify when doing ec2-user@<public-ip>
(ex: [email protected]
) in your SSH command or your Putty configuration
At the first time SSH to EC2 by key pair, you get this error:
Permissions 0644 for 'developer-course-kp.pem' are too open
[[email protected]](<mailto:[email protected]>): Permission denied
⇒ set 0400
permission for key pair: chmod 0400 mykeypair.pem
This is probably because you have stopped your EC2 instance and then started it again today. When you do so, the public IP of your EC2 instance can change. Therefore, in your command, or Putty configuration, please make sure to edit and save the new public IP.