SSH Troubleshooting: A Beginner's Guide

Ankur SinghAnkur Singh
1 min read

Having trouble connecting to your EC2 instance via SSH? Let's troubleshoot together!

Common Issues and Solutions

  1. Connection Timeout:

    • Check Security Groups: Ensure your security group allows inbound SSH traffic (port 22).

    • Firewall Interference: If the issue persists, check if a corporate or personal firewall is blocking the connection.

  2. SSH Not Working on Windows:

    • Use Putty: Download and install Putty for Windows-based SSH connections.
  3. Connection Refused:

    • Instance Status: Verify that your EC2 instance is running.

    • Restart or Recreate: If necessary, restart or recreate the instance using a supported operating system like Ubuntu, Amazon Linux 2, or another preferred distribution.

  4. Permission Denied (publickey, gssapi-keyex, gssapi-with-mic):

    • Correct Key: Ensure you're using the correct security key associated with your instance.

    • Correct User: Use the ec2-user when connecting to an Amazon Linux 2 instance.

  5. Nothing seems to be working 🤬 :

    • Try EC2 Instance Connect: This feature provides a secure connection to your instance without requiring SSH configuration.

  1. IP Address Changes:

    • Update Configuration: If your instance has been stopped and restarted, update the public IP address in your SSH command or Putty configuration.

Remember: If you're still facing difficulties, don't hesitate to consult the AWS documentation or seek assistance from the AWS community forums.

0
Subscribe to my newsletter

Read articles from Ankur Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ankur Singh
Ankur Singh

"Dedicated backend developer passionate about crafting robust and scalable applications. Proficient in Node.js, Express.js, MongoDB, and PostgreSQL. Experienced in handling pull requests, ensuring smooth production deployments. Committed to staying up-to-date with industry trends and delivering high-quality solutions on cloud platforms. Here, you'll find a collection of articles on a variety of technical topics, from cloud computing and DevOps to programming languages and web development. Whether you're a beginner or a seasoned pro, there's something here for everyone. Let's dive into the world of technology together!"