I've a server abc.example.com and a remote desktop zzz.example.com. I'm using SSH over a custom port, say, 6789. Whenever my firewall is off, I'm able to connect to the server successfully. But, as soon as I start my firewall, in vain. Moreover, I want to allow ssh session only between abc.example.com and zzz.example.com, for security reasons.This is the rule that I have added to my iptables on the server,iptables -A INPUT -s zzz.example.com -m state --state NEW,ESTABLISHED -p tcp --dport 6789 -j ACCEPT
Iptable rule to ssh over the internet
ssh;security;iptables;firewall