Skip to content

Not able to ssh or connect via Session Manager

0

Hello, I am not able to login to my ec2 instance via ssh. I get connection timed out error. I tried connecting via session manager however, even that is not working for me. My account is not authorized to connect via EC2 serial console. EC2 instance connect is also not working for me and if I want to install it I need to login to the server via ssh but as I said even ssh is not working. Unfortunately, the packages for ssh server and apache got uninstalled from my end. I have attached the log files for the server. I also got an error saying ssm agent is not able to connect to system manager but for other ec2 instances in the same region and az it is able to connect. SSM agent has also failed to start. I have attached a screenshot of the logs.Enter image description here I am using ubuntu linux. Has anyone faced this issue earlier and is aware how we can login to the ec2 instance? Or is there a way I can install ssh on this ec2 instance ?

Thanks & Regards, Anish

2 Answers
0

Hello.

Was it possible to originally connect to the target EC2 using SSH?
For example, have you changed the route table settings for the EC2 subnet or changed the network ACL settings and are now unable to connect?

By the way, have you tried restarting EC2?
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshoot-unreachable-instance.html

Also try restoring from a snapshot.
https://docs.aws.amazon.com/prescriptive-guidance/latest/backup-recovery/restore.html

I also think it would be possible to mount the root volume of the EC2 in question on a normal EC2, extract the necessary data, and restore it.
https://docs.aws.amazon.com/ebs/latest/userguide/ebs-using-volumes.html

EXPERT
answered a year ago
  • Hi,

    I have tried restarting the EC2 but it has not worked. Actually this ec2 instance is a node of an application which is in cluster and so we can't restore a snapshot else we will have to go through the entire process of configuring the application again. Attaching the root volume of current ec2 instance to a new ec2 instance will only help me in getting the data and our goal is to access the instance, installing ssh or via session manager.

  • Is EC2 registered as a managed instance in the Systems Manager Fleet Manager console? Also, if registered, is the status online? If you are not online, you cannot connect with Session Manager. If neither SSH nor a session manager can be used, it will be difficult to connect to the OS.

0

Hi, Does your EC2 instance has internet connectivity? If your instance is in a private subnet or doesn't have connectivity, you need either to configure a VPC endpoint for Systems Manager or use a NAT gateway.

AWS
answered a year 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.