I’m trying to connect my friend’s MySQL database remotely but I’m getting connection timeout error. I tried to ssh. But same result.
Then I check that instance. It has public IP. Also allowed 3306 and 22 ports on the security group. Allowed 100th rule for all sources in subnet NACL.
What I’m missing? Is there any other way to block those traffic? Can anyone help me? I’m a still beginner
2
Answers
I found the reason. That instance was deployed in a private subnet and didn't have inbound access.
Solution:- I deployed a bastion host in a public subnet and used SSH agent forwarding to access the instance through the bastion host.
When an SSH connection times-out, it is normally an indication that network traffic is not getting to the Amazon EC2 instance.
Things to check:
0.0.0.0/0
)See also: Troubleshooting connecting to your instance – Amazon Elastic Compute Cloud
Based on your descriptions, I would suggest checking whether the instance was launched in a public subnet.