All pastes #828396 Raw Edit

Stuff

public shellscript v1 · immutable
#828396 ·published 2007-12-22 12:46 UTC
rendered paste body
# create new table called "restricted_user"iptables -t filter -N restricted_user# add an OUTPUT rule to send traffic from $USENRAME to the restricted_user tableiptables -t filter -A OUTPUT -m owner --uid-owner $USERNAME -j restricted_user# allow traffic on localhostiptables -t filter -A restricted_user -o lo -j ACCEPT# reject all other trafficiptables -t filter -A restricted_user -j REJECT --reject-with admin-prohib# drop all traffic if rejecting failed (this shouldn't be necessary but just to be sure)iptables -t filter -A restricted_user -j DROP