2 Answers
- Newest
- Most votes
- Most comments
0
Hello.
What exactly are you running on EC2?
If it's a simple web server (such as Apache), I think it's possible that you're connecting using a port number that the web server isn't listening on.
For example, if you try to access via HTTPS even though you have not configured an SSL certificate or HTTPS settings, such an error may occur.
Is it possible to access it from a browser like below?
http://EC2-Public-IP-Address
0
Hello,
For your issue there will be several reasons:
- Check the security group for SSH, HTTP and HTTPS rules, they should be in allow state.
- Check the Instance is running or it is in stopped state.
- Check the software you are installed in the instance are running or not.
For more details refer the document:- https://repost.aws/knowledge-center/ec2-linux-resolve-ssh-connection-errors

Also, check if the web server is running in EC2. For example, in the case of Amazon Linux 2023, you can check the Apache status by running the following command. If it is not started, execute the start command on the second line.
It's not a timeout error, so I don't think it's blocked by a security group, but just to be sure, check if HTTP is allowed. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#describing-security-group