I have launched an instance with private IP only. Also in security group port 22 was allowed from everywhere. However when I was trying to connect the instance through Putty, it was showing network connection time out error.
I have created an elastic IP and assigned to the instance, but it was giving the same error.
Kindly help me on this.
Hi,
you need a public IP to SSH into your instance if you have not created a public IP and only a private IP is assigned means you hosted this instance in a private subnet and you can not directly ssh into pvt subnet instance.
Hello srivastava,
I have created an elastic IP and assigned to it, but still it was giving the same error. Elastic IP is also public IP, then why it was not accessible.
Hi,
I was wrong in the above answer you can connect with elastic IP also through ssh I used the below command ssh ec2-user@PublicIPv4DNS -i pemfilename, open ssh from anywhere in your security group.
Hello, I had opened 0.0.0.0 for port 22 and was trying to connect it from putty. But it was giving network timeout error. let me give a try again and let you know.
Hello, I have created a new instance but this time I have AWS auto-assigned public IP. Still, I am getting the connection timeout error. Attached the screenshots.
That screenshot is too low of a quality to be of use.
hello,
below is the description of the screenshot:
- The instance had AWS assigned public IP address.
- I was trying to connect the instance through Putty using its public IP address.
- The error I was receiving: Network error: Connection time out
- The instance security group has port 22 allowed for 0.0.0.0/0
Looks like either NSG is not correct or the IP is not attached. Are you doing this the AWS Playground?
yes,
The AWS has auto-assigned the public IP.
And the SG inbound rule has 0.0.0.0/0 for port 22 entry.
What is the protocol you have selected on port 22, TCP or UDP?
It was TCP protocol by default.
Can you connect to the VM with EC2 Instance Connect?
Also what is the AMI you have used?
I have not tried the Instance connect option. I was using the Redhat Linux AMI that is eligible for free tier.
Can you provide the AMI please?
Also I’ve just spun up an AMI and I can ssh to it. Can you try please:
3.95.204.208
I know you won’t be able to login but this is to test you can at least connect over SSH.
Thanks. Can you login via Instance Connect. Did the IP I gave you connect?
Does not it need keypair to connect the IP address?
You need a keypair to login, not to connect.