- Newest
- Most votes
- Most comments
Hello.
Have you checked the EC2 system logs?
There may be some error log output.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshoot-unreachable-instance.html#instance-console-console-output
Also, settings such as IAM roles are required for EC2, but is it possible to connect with Systems Manager SessinManager?
After connecting to EC2 with SessinManager, check the sshd logs to see if any abnormalities have occurred.
https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/connect-to-an-amazon-ec2-instance-by-using-session-manager.html
Hello.
Use EC2 Instance Connect (via AWS Console)
- Go to the EC2 Dashboard on AWS Console.
- Select your instance.
- Click Connect and choose EC2 Instance Connect (no need for a .pem key).
- Click Connect and see if you can access the instance.
Check Security Group
- Make sure the Security Group attached to your instance allows port 22 (SSH) for your current IP address.
- In the EC2 Dashboard, go to Security Groups under Network & Security.
- Confirm there is an inbound rule for port 22 with your IP (or 0.0.0.0/0 temporarily).
Use AWS Systems Manager (Session Manager) (if IAM permissions allow it)
- In EC2 Dashboard, click Connect and choose Session Manager.
- If your instance has the required IAM role, you can use Session Manager to connect without SSH.
https://medium.com/thecodr/using-an-ssh-client-to-connect-to-an-ec2-instance-65e537df1655
Thank you I successfully connected to my instance via Systems Manager. Ownership was wrong for /home/ubuntu directory.

Thank you I successfully connected to my instance via Systems Manager. Logs told me "bad ownership or modes for directory /home/ubuntu" when I tried to connect. Now I remember that I've changed owner ship. I revert to initial owner ship, problem solved now ! Thank you again.