Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to monitor all network traffic from a specific process in linux?

I want to monitor and log all traffic that a specific process produces.

I know about tcpdump, but it seems it doesn’t support filtering by process (pid/path, or at least user).

It there any other way to log all traffic from a process? Ideally I should be able to filter ports as well.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Thanks!

>Solution :

You should use strace command:

strace -o /tmp/network.out -e trace=network -fp <PID>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading