Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

How to troubleshoot SSH connection issues with AWS EC2

Jan 24, 2020

Share this post

EC2 Instance connect allows one to connect EC2 instance directly from browser. If you are trying from command line or putty and experiencing issues.. please see below cases.

Case-1: Connection timed out.

If your EC2 instance is running and trying to SSH with correct IP (there will be a change in IP after each restart), there must be a security group issue. Any timeout is related to security group or a firewall, ensure your security group is correct (port, protocol, source IPs etc) and assigned to the EC2 instance.

If there is still a connection timeout issue, it means a corporate firewall, or a personal firewall is blocking the connection. Please use EC2 instance connect.

Case-2: Connection refused.

    • It means the EC2 instance is reachable but SSH utility is not running. Please install SSH client on your local machine and try again.

Case-3: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

    • This means either three things:
    • You are using wrong security key or not using a security key. Please look at your EC2 instance configuration to make sure you have assigned the correct key to it.
    • You are using wrong user. Please try with ec2-user.
    • Key file permissions are incorrect. Please change it to 0400 (in case of Windows, please ensure nobody else has any level of access to the file except you).

Case-4: No supported authentication methods available (server sent: publickey, gssapi-keyex,gssapi-with-mic) error when trying from Putty.

This happens when you do not use key in  .ppk format.

    • Open PuTTYgen -> Go to File -> Load private key and open “.pem” file.
    • Save private key in “.ppk” format.
    • Now, load your session in putty (ec2-user@IP) -> SSH -> Auth -> browse private key which you just saved and hit open, you should be all set and logged onto EC2 instance.