Skip to content

Unable to connect ec2_instances. Network error: connection to "my ip" refused.

0

Hello,

This is an URGENT request. Kindly reply ASAP. That would be much appreciated.

Day before yesterday i created two ec2 instances and worked on that servers. when i try to login today, i am unable to login. I am getting an error in winscp and putty, says "Network error: connection to "<my ip>" refused. i checked the below points: 1 in security group, inbound allowed for ssh port 22 2 Checked NACL, both inbound and outbound allowed for ssh port 22 3 Instance status is 2/2 checks passed 5 No key pair issues (usual key pair only) 6 Reboot also done 7 checked ENI 8 Subnet is allowed igw traffic (0.0.0.0/0) 9. no firewall block 10. Tried in "EC2 instance connect" option from console I checked all these things, but still not connecting?

Thanks, Ragav

asked a year ago269 views
1 Answer
1

Hello.

6 Reboot also done

You mentioned that you restarted EC2, but has the public IP of EC2 changed?
If ElasticIP is not set on EC2, the public IP will change.
https://repost.aws/knowledge-center/ec2-recover-ip-address

Also, is it possible to connect using SSM Session Manager instead of SSH?
If you are using Amazon Linux 2023, etc., the SSM agent is preinstalled, so you will be able to connect by setting the necessary IAM role.
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html

EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
  • already elastic ip has set

  • If so, can you connect with Session Manager and check if sshd is running?

  • should i install SSM agent to connect with Session Manager? This is the error message what i am getting. "SSM Agent is not online The SSM Agent was unable to connect to a Systems Manager endpoint to register itself with the service." Even after i installed ssm (placed installation commands through user data) it doesn't work.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.