Network traffic monitoring for each user

US flag

There are several users in Ubuntu server using the network traffic. I need to monitor each users traffic usage. I used nethogs but apparently it gives me the answer for each process so when the user disconnects and connect again it opens a totally different row is created. Is there a way that I can filter this out or use another method or package to get the usage by each user. And I need it to be saved on the server I can't have a terminal open for this matter.

Btw, I'm using Ubuntu 20.04 Please feel free to ask me about other information that can help you give me an answer.

in flag
Welcome to AskUbuntu. Linux distributions generally do not monitor bandwidth on a per-user basis, so something bespoke will need to be set up with scripting and `iptables` commands. Does everyone who uses this server use the same set of limited ports? Or are you planning on tracking absolutely everything that is done?
Matin Ebrahimkhani avatar
thank you for responding. they do not use limited ports I need to monitor everything
in flag
In that case, you will need enterprise-grade server monitoring tools. Many are available with a free tier, though you’ll need to do the research to determine which one collects the metrics that you’re looking for. Each one has its own set of pros and cons.
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.