Skip to content

Ec2 instance - SSH not working now

0

I have an ec2 instance that I have been using from a long time. I was able to do ssh to the instance earlier. Today, I upgraded the OpenSSH version in the same. I am no longer able to SSH to the instance via any of the methods.

Is there any workaround way of getting the console access so that I can resolve the SSH issue with the Ec2 instance?

It is urgent!

asked 2 years ago672 views

3 Answers
3

Have you tried connecting to the EC2 via systems manager? It will require access to SSM and have the correct IAM Role

https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html#start-sys-console

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

1
EXPERT

answered 2 years ago

0

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.
EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.