EC2 Instance - Can't connect to WebServer through SSH

I can't connect to Webserver using SSH. The Webserver also has Public IP address.

I have followed the troubleshooting guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html
I have checked from from Internet Gateway up to EC2 Instance and its Security Groups settings. 

No blackhole status in the route table.

Is there anything I missed? Thanks!!
  • post-author-pic
    Zafar M
    12-28-2018

    1. Ping the public address first.
    2. Did you download the pem key and set the permission correctly and used following command format to connect

     ssh -i "keypair.pem" ec2-user@ec2-18-208-153-230.compute-1.amazonaws.com

  • post-author-pic
    Nz V
    12-28-2018

    Hello Donny,

    I am doing the course and I got stuck in the same place just about 15 mins ago!. I manged to sort it out.

    Check your default NACL inbound rules and ensure you are allowing ssh traffic i.e., rule 100. If you are seeing rule 90 to deny the traffic please delete it and try again.

  • post-author-pic
    Ell M
    12-28-2018

    Hi Donny, I wanted to check in and make sure you had been able to connect. 

  • post-author-pic
    Donny D
    12-28-2018

    Hi mdnawy111,
    Hi  Ell Marquez,


    Thanks for the replies!! 
    I finally figured out the main issue. It's the firewall used by the company.
    So I went back and recreated the EC2 from home and managed to connect without any trouble.

    Thanks again You Two!! :) 

  • post-author-pic
    Ermin K
    12-28-2018

    Nice well done and I am glad you got it solved. Hey by the way we have playground servers that allow you to access servers via port 80-443 with ssh so you should be able to connect to them even from your company environment.

  • post-author-pic
    Donny D
    12-29-2018

    Hi Ermin Kreponic,

    Thanks!! I can verified that the labs have been working fine from office computer so far.  

    Only the one from AWS free tier account that I created doesn't work (which is okay since I can always go home and exercise).

    Thanks again!!!

Looking For Team Training?

Learn More