Issue
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
Solution
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:
- The instance is running Linux
- The instance is launched in a public subnet, which is defined as having a Route Table entry to points to an Internet Gateway
- The instance has a public IP address, which you are using for the connection
- The Network Access Control Lists (NACLs) are set to their default "Allow All" values
- A Security Group associated with the instance that permits inbound access on port 22 (SSH) either from your IP address, or from the Internet (
0.0.0.0/0
) - Your corporate network permits an outbound SSH connection (try alternate networks, eg home vs work vs tethered to your phone)
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.
Answered By - John Rotenstein Answer Checked By - Timothy Miller (WPSolving Admin)