- Newest
- Most votes
- Most comments
Hello,
Have you checked the status of your EC2 instance through status checks?
It’s possible that an internal issue with the instance is preventing SSH access. In this case, you can diagnose the problem using status checks.
Status checks are performed every minute, returning a pass or a fail status. If all checks pass, the overall status of the instance is OK. If one or more checks fail, the overall status is impaired.
For example, if the status checks show “1/2 checks passed,” you can try stopping and restarting the instance.
For more details, please refer to the following: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html
If you’ve already confirmed that the status checks are normal, you can check the following:
- If you're not using the Default VPC, check whether the routing table has a route to the Internet Gateway.
- If you're not using the Default VPC, ensure that the Internet Gateway is assigned to the subnet where your EC2 instance is located.
- Check the EC2's Monitoring section to see if CloudWatch metrics are being recorded properly. If there’s an issue, you may want to try restarting the instance.
answered 2 years ago
hello, verify that your instance is ready, verify the following: In the Instance state column, verify that your instance is in the running state. In the Status check column, verify that your instance has passed the two status checks.
hey, yes we verified it's ready and is running. also passed 3/3 checks. thanks
If you’ve already confirmed that the status checks are normal, you can check the following:
- If you're not using the Default VPC, check whether the routing table has a route to the Internet Gateway.
- If you're not using the Default VPC, ensure that the Internet Gateway is assigned to the subnet where your EC2 instance is located.
- Check the EC2's Monitoring section to see if CloudWatch metrics are being recorded properly. If there’s an issue, you may want to try restarting the instance.
thanks, already did those before.
- we're using the default vpc config.
- we're using the default. but i did check the subnet and it does point to an internet gateway.
- there's not much traffic yet but it does log some activity in the instance. I also did a restart earlier btw.
Hello,
You can set up the VPC Reachability Analyzer as follows:
- In the Path Source section, select Internet Gateways as the Source type.
- In the Path Source section, choose the Internet Gateway of the VPC where the instance is located as the Source.
- In the Path Destination section, select Instances as the Destination type.
- Choose the instance as the Destination.
If the Reachability status is "Reachable," it means that the network settings on AWS are correctly configured. If the status is "Not reachable," you can get hints in the Explanation section.
If the Reachability status is "Reachable," the issue may be internal to the instance. You can try accessing the instance using Session Manager to investigate internal issues. Keep in mind that using Session Manager incurs charges.
Prerequisite: To use Session Manager, the instance must have the appropriate IAM permissions. Follow these steps to apply an IAM role:
- Select the instance, click the Actions button, and choose Modify IAM role.
- Click Create new IAM role, which will take you to the IAM service.
- Click Create role, and set the Trusted entity type to AWS service. Choose EC2 as the use case.
- In the Permissions policies, search for and select the AmazonEC2RoleforSSM AWS Managed Policy.
- Enter a name for the role, create the role, and then apply it to the instance.
You can install the agent required for Session Manager by following these steps:
- Stop the instance.
- Click the Actions button, then select Instance Settings, and choose Edit user data.
- Enter the following user_data value (for Amazon Linux 2023):
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="cloud-config.txt"
#cloud-config
cloud_final_modules:
- [scripts-user, always]
--//
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="userdata.txt"
#!/bin/bash
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo systemctl start amazon-ssm-agent
--//--
- Start the instance.
- Click the Connect button, then select Session Manager to attempt connection through Session Manager.
If you cannot connect and see a message saying the SSM Agent is not connected, it may indicate an issue with the environment, and the installation may not have completed successfully. You can refer to the appropriate installation methods for each environment in the AWS documentation and change this section for your environment.
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo systemctl start amazon-ssm-agent
If the connection is successful but the SSM console cannot connect, this suggests that the instance may have an internal issue that cannot be resolved. You could consider using user_data to disable internal routing tables or firewalls as a last resort.
answered 2 years ago
thanks for that very detailed instruction. i did the reachability analyzer test and it is reachable. so I believe your first suggestion re firewall might be what's causing this. or maybe something similar to that. we'll have to try Session manager or some other way of getting into the instance.
I was thinking of creating another instance and move the volume/storage there and try connecting to it. you think that would work?
Hello,
During our previous discussions, I realized that my earlier response may not have been the most effective solution, especially given recent updates. I wanted to follow up and provide a better solution in light of this.
In the scenario you described, a quick and accurate approach would be to detach the EBS volume, create a new instance, then attach the volume to the new instance and mount it in the instance to complete the task.
I apologize for any inconvenience caused by my initial response not being the optimal solution.
Have you changed the inbound rules of the security group assigned to the instance? If you're using the Amazon EC2 console to connect to your instance using EC2 Instance Connect, you need an inbound rule that allows SSH traffic from the EC2 Instance Connect service. For the instructions for configuring this rule, please see the following AWS documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-tutorial.html#eic-tut1-task2
answered 2 years ago
yes i did. i've added the ec2-connect. also tried with inbound rule that accepts 0.0.0.0/0 for testing. still not connecting in ssh and ec2 instance connect.
Relevant content
- AWS OFFICIALUpdated 16 days ago

thanks, already did those before.
we're using the default vpc config. we're using the default. but i did check the subnet and it does point to an internet gateway. there's not much traffic yet but it does log some activity in the instance. I also did a restart earlier btw.
The issue might be due to firewall settings on the instance server. In this case, since external access is already blocked, you can set up a command to run using the user_data script.
For example, if you configured Uncomplicated Firewall settings within your EC2 instance, you can consider following these steps:
user_data script:
With this script, the user_data will run each time the instance is restarted, and the firewall will be disabled using ufw disable.
After this, you may need to configure it so the script does not run again in the future.
will try, thanks
still can't connect to it
I’d like to help, but it’s difficult to accurately diagnose the issue at this point. If you can provide more context about the current situation, I’ll try to suggest other solutions.
For example, it would be helpful to know what tasks the EC2 instance is performing or if it’s possible to access the instance through other protocols. This information could allow me to offer further assistance.
If the situation is urgent, you may also consider opening a support case to get more precise help. ;)
the instance is not accessible in any protocols except ssh for maintenance, other than that it's all outgoing.
i was trying to avoid it, I just found out they charge for tech support. wow. :D
i don't understand why we're able to access it before and now we cant, maybe there was an update or new feature... thanks