I've been researching how to limit a user's monthly TCP download plus upload quotas. The total transfer limit is 1 TB / month . There are 50 users, so I wish to limit each user to a maximum of 20 GB / month . I've looked up iptables rules and bandwith limiting. If it makes a difference, the users will connect through an ssh client and dynamically forward their ports.Is there a solution for doing a total transfer quota per month per user for 20 GB ? Perhaps there is a way of creating an interface for everyone and limiting it ? Or perhaps I can poll  RX/TX and stop the user when limit is reached ?UpdateThis is for debian linux. I finally stumbled upon /proc/:pid/net/dev (pretty much by accident) which shows a total receive/transmit bytes by process. I can use this with process user information to find out total sshd process network usage for each user.UpdateApparently all pids show the same net/dev stats.
limiting a user's TCP transfer quota
networking;ssh tunneling;limit