I am currently trying to configure ufw on Ubuntu 12.04 but to my understanding it behaves oddly. i tried allowing just some services on a remote machine, denying everything else. I thought - anyway, i might have gotten it wrong - that denying all by default and then allowing some services would serve my purpose, hence i emitted the following commands
ufw allow ssh
ufw default deny incoming
ufw default deny outgoing
To my understanding the last command would only block every connection i am trying to establish from the remote computer to some other computer, but it caused all connections i am trying to establish to the remote computer ending up being rejected. I am pretty sure that this command and not the deny incoming caused this behavior. To me this is quite counter-intuitive. I would suggest that, if I explicitly allowed ssh, i would be able to establish an connection to the remote machine, independent of the default settings. Even more it seems quite strange that blocking the outgoing connections breaks my ssh.
I would be very grateful if anyone could explain this to me.