Log ports opened by an application

Posted by Simon A. Eugster on Server Fault See other posts from Server Fault or by Simon A. Eugster
Published on 2012-09-22T13:34:43Z Indexed on 2012/09/22 15:39 UTC
Read the original article Hit count: 219

Filed under:
|

I'm searching for something like:

tcpdump -p PID        # But tcpdump does not know the PID

or

lsof -i --continuous  # But lsof just runs and exits, no «live logging»

to log which connections an application opens.

In my case, I want to find out to which port git connects when committing. This happens in a fraction of a second, so I cannot use lsof. If there is a lot of traffic, filtering by PID or process name would be useful.

© Server Fault or respective owner

Related posts about linux

Related posts about networking