Skip to content

Why I am not able to SSH ec2 using connect button from my laptop but able to do it from another laptop?

0

Hello All, I am struggling to connect to ec2 instance using the connect button -> EC2 instance connect in the AWS management console.

I am able to connect to instance from my personal laptop by using 3rd party tool like mobaxterm and also from CMD hence I don't think there is any firewall issue on my laptop.

When I created my aws account first time I was able to connect to ec2 instance via connect button in the management console from the browser. don''t know what happened later.

I tried everything by enabling pop up in my chrome browser and also in incognito mode. I tried using mozilla and edge browsers too, Still its the same story.

The ppm key file has this permission600.

asked a year ago297 views

2 Answers
-1

This issue where EC2 Instance Connect works from one laptop but not another is typically caused by one of several factors:

  1. Security Group Configuration: The most common cause is that your security group doesn't allow inbound SSH traffic (port 22) from the EC2 Instance Connect IP range for your specific AWS region. Each region has its own IP range that needs to be allowed in your security group's inbound rules.

  2. Network Configuration: Your current laptop might be on a network that's blocking outbound SSH connections or has firewall rules preventing the connection. Since you mentioned you can connect using MobaXterm and CMD from the same laptop, this suggests the issue is specific to the browser-based connection.

  3. Browser Settings: Even though you've checked pop-up settings, there might be other browser extensions or security settings blocking the connection. Try completely disabling all extensions temporarily.

  4. IAM Permissions: Your IAM user might not have the necessary permissions to use EC2 Instance Connect. Verify that your user has the "ec2-instance-connect:SendSSHPublicKey" permission.

  5. Instance Status: Check if your instance has passed all status checks. A failing status check could indicate an OS-level issue preventing connections.

  6. EC2 Instance Connect Prerequisites: Ensure the EC2 Instance Connect package is properly installed on your instance if you're using a supported Linux distribution.

Troubleshooting steps:

  • Try stopping and starting your EC2 instance (not just rebooting)
  • Double-check your security group's inbound rules to ensure they allow traffic from the EC2 Instance Connect IP range for your region
  • Verify your VPC and subnet configurations for proper internet connectivity
  • Try using AWS Systems Manager Session Manager as an alternative connection method
  • Clear your browser cache and cookies completely

Since you can connect using other methods from the same laptop, the issue is likely related to how the browser-based EC2 Instance Connect feature interacts with your specific network or browser configuration.
Sources
I am not able to connect my instances by clicking the connect button. | AWS re:Post
EC2 Instance Connect cannot connect to my instance ! | AWS re:Post
Port 22 (SSH) is not authorized | AWS re:Post

answered a year ago

EXPERT

reviewed a year ago

  • Hello Team,

    These are the below steps I had taken to resolve the issue but still I was not able to ssh ec2 instance using the connect button.

    1. I am on free tier of AWS and I am logging in AWS management console as root user and not IAM.
    2. I created and deployed an application on ec2 instance. I am not able to ssh it using the connect button in the AWS management console. But I am able to SSH the same ec2 instance from another laptop/machine when I press the connect button. This implies that there is no problem in the security group, inbound rules, network configurations, VPC and instance status.
    3. In order to mitigate the browser issue. I installed another browser (firefox) with default settings and also enabled pop ups in it. Still I was not able to ssh ec2 instance from the newly installed bowser.
    4. I also uninstalled my kaspersky antivirus and also mobaxterm, Restarted my laptop and still I was not able to ssh ec2 instance from the browser using the connect button.
    5. I am able to ssh ec2 instance from my CMD but not through the browser.

    I request amazon team to please look into this issue and help me to connect to ec2 instance from the browser as it is more convinient then connecting from any 3rd party tool.

-1

For a start, what Linux OS are you running?

EC2 Instance Connect (EIC) has some prerequisites

  • a supported OS. Installation may be required
  • inbound SSH traffic allowed from com.amazonaws.region.ec2-instance-connect (IPv4) and com.amazonaws.region.ipv6.ec2-instance-connect (IPv6) where region is your Region code
AWS
EXPERT

answered a year ago

EXPERT

reviewed 4 months ago

  • Hi MikeLim!

    Below are my observations and Point 3 and 4 are very important!

    These are the below steps I had taken to resolve the issue but still I was not able to ssh ec2 instance using the connect button.

    1. I am on free tier of AWS and I am logging in AWS management console as root user and not IAM.
    2. My Host OS is Windows 11 Pro edition.
    3. I created and deployed an application on an ec2 instance (Ubuntu OS latest 24 edition available in free tier). I am not able to ssh it using the connect button in the AWS management console. But I am able to SSH the same ec2 instance from another laptop/machine when I press the connect button. This implies that there is no problem in the security group, inbound rules, network configurations, VPC and instance status.
    4. In order to mitigate the browser issue. I installed another browser (firefox) with default settings and also enabled pop ups in it. Still I was not able to ssh ec2 instance from the newly installed bowser.
    5. I also uninstalled my kaspersky antivirus and also mobaxterm, Restarted my laptop and still I was not able to ssh ec2 instance from the browser using the connect button.
    6. I am able to ssh ec2 instance from my CMD but not through the browser.

    I request amazon team to please look into this issue and help me to connect to ec2 instance from the browser as it is more convinient then connecting from any 3rd party tool. I really don't have any clue what is causing this issue.

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.