[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: network administration question



On Fri, Feb 15, 2002 at 04:15:05PM -0700, Theo de Raadt wrote:
> > Not sure this is what you want, but lsof in the ports will show you
> > the process name and PID that is associated with a port number.
> > 
> > So lsof -i shows you:
> > 
> > COMMAND   PID   USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
> > sshd    17767   root    3u  IPv6 0xe096c500      0t0  TCP *:ssh (LISTEN)
> 
> No need to install some dumb package
> 
> % fstat | grep '*:22'
> root     sshd       21156    3* internet6 stream tcp 0xe179ec78 *:22
> root     sshd       21156    4* internet stream tcp 0xe179ed5c *:22

Thanx to all for your answers. fstat(1) is exactly what i needed.

Alf