Skip to main content
forseti

10 months ago

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!!

Image of amohiuddin
amohiuddin
10 months ago
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

Image of mdnawy111
mdnawy111
10 months ago
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.

Image of ellmarquez
ellmarquez
10 months ago
Hi Donny, I wanted to check in and make sure you had been able to connect. 
Image of forseti
forseti
10 months ago
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!! :) 
Image of ermin
ermin
10 months ago
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.
Image of forseti
forseti
10 months ago
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!!!