How to open only tcp-22 and close other ports in iptables # iptables -t filter -A INPUT -p tcp --dport 22 -j ACCEPT # iptables -t filter -A INPUT -j DROP