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

link|improve this question

10% accept rate
possible duplicate of iptables Ubuntu VPS SSH rule – mailq Oct 2 '11 at 20:20
feedback

1 Answer

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.