I have a home laptop running Windows 7 and have just set up an Amazon aws ec2 instance running Ubuntu. The Ubuntu instance has the public IP address 126.96.36.199. I use PuTTY to ssh to the ec2 instance. I have found that setting up the iptables rules, on the Ubuntu instance as follows, prevents me from using ssh to access the Ubuntu ec2 instance.
sudo iptables -A INPUT -i lo -j ACCEPT sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT sudo iptables -A INPUT -d 188.8.131.52 -p tcp --dport 22 -j ACCEPT sudo iptables -A INPUT -j DROP
I have set my security group up to allow ssh input and output on port 22. I cannot understand why the sudo iptables -A INPUT -d 184.108.40.206 -p tcp --dport 22 -j ACCEPT
line does not allow me to ssh using PuTTY.