Can't connect to AWS Windows or Linux instances anymore

Viewed 2975

I've been using AWS free tier for a while. I can usually create new instances and connect to them with no issues. One week ago I started getting the Session Manager message in bold below while trying to connect.

I've did some troubleshooting, tried every step suggest by AWS but still no luck. I can still create instances but can't connect. The problem isn't related to a specific instance, it's impacting any instance I create. I've tried rebooting but no change and the instance/s do not appear in System Manager Session Manager console.

We weren't able to connect to your instance. Common reasons for this include: SSM Agent isn't installed on the instance. You can install the agent on both Windows instances and Linux instances. The required IAM instance profile isn't attached to the instance. You can attach a profile using AWS Systems Manager Quick Setup. Session Manager setup is incomplete. For more information, see Session Manager Prerequisites.**

1 Answers

If you are not using the Default VPC for the EC2 Instance that you created then you need to attach an Internet Gateway for the VPC that you are planning to use for the EC2 Instance.

Do the following:

  1. Create VPC and subnets How to Create VPC and Subnets

  2. Create Internet Gateway How to Create and Attach Internet Gateway

  3. Now create you EC2 Instance using the VPC you created and For auto assign pubic IP will be disabled if you are using non default VPC (i.e. one we create manually) so enable it like this while creating the instance. (Select the vpc and subnet you created in Step 1 for Network and Subnet field in the bottom image) enter image description here

  4. Also ensure that SSH accepts is enabled from anywhere while creating the security group in AWS for the ec2 instance

  5. Now once the instance is launched you would be able to access it via SSH

     ssh -i your_certificate.pem username@public_ip 
    

Hope you find it useful.

Note: message saying "Session Manager setup is incomplete" may still persist but you will be able to access the box by using SSH if you follow the above steps and this message comes because the SSM Agent might not be installed. Kindly refer this Complete the Session Manager Setup

Related