1
votes

I followed everything in exact same order as refered here :Amazon Set Up Documentation. I also read many SO answers but everyone suggested on checking the security group and route tables. I did everything none of them helped.

I have a USB Dongle which I use to surf internet. Its IP changes everytime I disconnect the dongle and reconnect it. But if I stay connected its IP remains same. So I did created a security group my_ip/32 and launched an ec2 instance. So without disconnecting my dongle i.e keeping my IP intact I tried to connect to the instance through SSH with simple

ssh -v -i my-key-pair.pem user@public_dns

command but with no luck.

But the funny thing is I can connect to the ec2 instance if I change my security group to 0.0.0.0/0 which is not suggested by amazon because of security issue.

Does anybody has faced the similar situation. Or Amazon did miss something in their documentation.

NOTE: I also enable firewall in ubuntu for ssh as follows:

sudo ufw allow ssh/tcp
sudo ufw enable

Am I missing something??

1
You seem to be missing pertinent information. You stated you use a USB dongle -- and? What is the dongle? Is it an ethernet cable? What does provide connectivity to? Who provides your internet connection? How is your workstation setup? It appears from the back and forth you had in the answer below there are things about your own setup (possibly that your browsers are proxied) that apparently explain your issue. It would be helpful if you researched that information and updated your question.gview

1 Answers

1
votes

When you google 'what is my ip' does it give you the result you expected for my_ip? Google will report back the IP the outside world sees you as.

I have a feeling you might be going through a NAT router which you're recieving DHCP from, as such you're dongles IP isn't even being seen by EC2 to match a security group.