- Newest
- Most votes
- Most comments
Hi Avanegas,
From my understanding you are trying to connect to your Linux instance using PuTTY from another network but you are getting a network error.
I would advise you to ensure that your Security Group has the correct Inbound and Outbound rules to allow for traffic outside your network to access the instance. As well as checking the Network Access Control List (NACL). For more information on Security Groups: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html and for more information on NACLs: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html
You can check the Security Group by:
• Navigating to the EC2 console https://console.aws.amazon.com/ec2/
• On the left select Instances
• Select the Linux instance you are trying to connect to
• On the Security tab at the bottom of the console page, under Inbound rules, check the list of rules that are in effect for the selected instance - for Linux instances: Verify that there is a rule that allows traffic from the network (IP address range) that your computer is connected to, to port 22 (SSH).
• You can also check under Outbound rules, that all traffic is allowed out
You can check the NACL by:
• Navigating to the EC2 console https://console.aws.amazon.com/ec2/
• On the left select Instances
• Select the Linux instance you are trying to connect to
• On the Networking tab at the bottom of the console page, click your VPC ID
• Select the VPC, and on the Details tab click Main network ACL
• For Inbound Rules, verify that the rules allow traffic to reach the VPC. Otherwise, delete or modify the rule that is blocking traffic.
• For Outbound Rules, verify that the rules allow traffic to leave the VPC. Otherwise, delete or modify the rule that is blocking traffic.
It could also be, that since you are trying to connect from another network, that there is a firewall blocking your access. Please ensure, if there is a firewall, that it allows the necessary inbound and outbound traffic for connecting to the instance. For example, port 22 for Linux instances.
Please check your route table for the subnet that the instance is in. Verify that there is a route with 0.0.0.0/0 as the destination and the internet gateway for your VPC as the target. You can check by:
• Navigating to the EC2 console https://console.aws.amazon.com/ec2/
• On the left select Instances
• Select the Linux instance you are trying to connect to
• On the Networking tab at the bottom of the console page, click your VPC ID
• Select the VPC, and on the Details tab click Main route table
• Under the Routes tab, you can check the routes
From what you have described, if you are getting this error message - Network error: Connection timed out or Error connecting to instance, reason: -> Connection timed out: connect , try the following the troubleshooting steps here:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectionTimeout
With regards to connecting to a Linux instances using PuTTY you can view the official AWS doc to ensure you satisfy the prerequisites:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html
You can view this document with regards to troubleshooting other common errors when trying to connect: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html
I hope this helps! Please let me know if you have any questions.
Edited by: amz99 on May 28, 2021 8:14 AM
Relevant content
- asked 7 months ago
- asked 2 years ago
- asked 7 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 7 months ago