How to block all local outbound traffic except for Tor in Debian.
A few simple "iptables" commands can do this. As root, enter:
# iptables -F OUTPUT # iptables -A OUTPUT -j ACCEPT -m owner --uid-owner debian-tor # iptables -A OUTPUT -j ACCEPT -o lo # iptables -P OUTPUT DROP # iptables -L -v
The last command will display the number of packets that have been allowed through per rule or else dropped.
The only reason this is specific to debian is the username, "debian-tor." (What user does tor run as on other distros?)