Originally Posted by Harlin
I would like to stop outbound ssh (port 22) using IPTables. Does anyone know what I would need to type with IPTables to get this to work?
Have you read the iptables manpage (man iptables) and/or the http://iptables-tutorial.frozentux.net
The match you want is the simplest that exist.
Also did you search the forums here ?
You want to drop outbound traffic, so the chain you want is "OUTPUT"
You want to drop SSH traffic,so the protocol is "tcp" and the port is "22".
you build the rule like this.
iptables -A OUTPUT -p tcp --dport 22 -j DROP
You can add the interface with "-i" like bulliver mentioned.Without it, the rule is more generic.
You can also add "--syn" to match only SYN packets (the ones that start the connection).