Connect from one server to another via SSH, Iptable rules needed
772
I have 2 servers and want to be able to connect via SSH from server A to B and vice versa. What Iptables rules should I set on both machines to make this possible ?
SSH is runnning on default port 22
You should add the next rule to both hosts. You can define source and destination ip address (-d) in case you only want to connect from this hosts in a bilateral connection. In any case you should take a look to the iptables documentation
iptables -A INPUT -p tcp --dport 22 --m state --state NEW,ESTABLISHED -j ACCEPT
You should add the next rule to both hosts. You can define source and destination ip address (-d) in case you only want to connect from this hosts in a bilateral connection. In any case you should take a look to the iptables documentation
iptables -A INPUT -p tcp --dport 22 --m state --state NEW,ESTABLISHED -j ACCEPT