Restrict a given network interface for a particular user using iptables on Linux

I assume that users A and B are using the same Linux machine(s) where you are the administrator.

The following command will prevent the user with uid 1234 from sending packets on the interface eth0:

# iptables -t mangle -A OUTPUT -o eth0 -m owner --uid-owner 1234 -j DROP

Thanks to this StackExchange thread.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *