Bitbucket SSH and iptables
- by Astaz3l
I'm a newbie in iptables to be honest. I have some basic rules. Everything is blocked by default.
iptables -t filter -F
iptables -t filter -X
iptables -t filter -P INPUT DROP
iptables -t filter -P FORWARD DROP
iptables -t filter -P OUTPUT DROP
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
...some rules for http, ftp etc...
iptables -t filter -A OUTPUT -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -t filter -A INPUT -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
With the last two lines i'm trying to open the access for ssh so i can connect to bitbucket.
When i try to connect to bitbucket:
ssh -Tv [email protected]
I got the error - connection timed out. But when I disable iptables i can connect without any problems.
What am i missing? Should I add any additional rules?