Mapping inet connections to pids

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Mon Aug 20 00:10:53 AEST 1990


In article <1990Aug3.225954.25180 at indetech.com> cse at indetech.com (Scott Ellard) writes:
> Is there a UNIX command that relates active internet
> connections to the pids which own those connections?

Not portably; there are no system calls to retrieve such information,
even if it is stored. What do you need the pids for?

> If there is no such command/option, has anyone written
> a program to do this that they might share?

My auth package (c.s.unix volume 22) records the uid and pid that
started any authenticated connection; the uid is available through the
network as per RFC 931, and you can easily modify the daemon to spit out
the pid.

---Dan



More information about the Comp.unix.wizards mailing list