outgoing traffic accounting per user on linux server


for login in $(cat /etc/passwd | grep hosting\ client | cut -d: -f1); do iptables -N out_user_$login; iptables -A OUTPUT -m owner --uid-owner $(id -u $login) -j out_user_$login; done

iptables -L OUTPUT -n -v | grep M\ out_ | sort -k2

Leave a Reply

Your email address will not be published. Required fields are marked *