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 184.108.40.206. 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 220.127.116.11 -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 18.104.22.168 -p tcp --dport 22 -j ACCEPT
line does not allow me to ssh using PuTTY.