Bitbucket SSH and iptables
Posted
by
Astaz3l
on Super User
See other posts from Super User
or by Astaz3l
Published on 2014-06-04T14:56:00Z
Indexed on
2014/06/04
15:30 UTC
Read the original article
Hit count: 407
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?
© Super User or respective owner