- Newest
- Most votes
- Most comments
Have you tried connecting to the EC2 via systems manager? It will require access to SSM and have the correct IAM Role
Hello Arshaan
Check once these steps it help to resolve your issue:
There are a couple of workarounds you can try to regain access to your EC2 instance after an SSH upgrade issue:
Security Group Check: Double-check your security group configuration. Ensure the inbound rule allowing SSH access (port 22) is still active and configured correctly. This includes verifying the source (your IP address or a wider range for testing purposes) and that the instance state is running.
AWS Systems Manager Rescue: If the security group looks fine, AWS offers an "EC2Rescue" feature through AWS Systems Manager. This launches a temporary instance in your VPC and allows you to attach the root volume of your original instance. With this access, you can potentially fix the SSH issue on the original volume.
- Make sure your EC2 instance is in a public subnet with a route table pointing to an internet gateway.
- Verify you're using the correct public IP address for the instance (it might have changed if you restarted it).
- Consider temporarily widening the source for the SSH access rule in your security group for troubleshooting purposes (0.0.0.0/0), but remember to tighten it back to a more secure configuration later.
