title: iptables: allow OUTPUT only for http and ssh
body: <p>How to allow outgoing trafic only for http and ssh?</p>
  
  <p>i've tried:</p>
  
  <pre><code> iptables -A OUTPUT -p tcp --dport ssh -j ACCEPT
   iptables -A OUTPUT -p tcp --dport http -j ACCEPT
  </code></pre>
  
  <p>but as soon as i add </p>
  
  <pre><code>iptables -A OUTPUT -j DROP
  </code></pre>
  
  <p>nothing works, it blocks everything. </p>
  
  <pre><code>Chain INPUT (policy ACCEPT)
  target     prot opt source               destination
  ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
  ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:22151
  ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http
  ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:sso-service
  ACCEPT     all  --  anywhere             anywhere
  DROP       all  --  anywhere             anywhere
  
  Chain FORWARD (policy ACCEPT)
  target     prot opt source               destination
  
  Chain OUTPUT (policy ACCEPT)
  target     prot opt source               destination
  ACCEPT     all  --  anywhere             anywhere
  </code></pre>