Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2004 15:31:59 -0800
From:      James Wu <admin@znode.org>
To:        freebsd-newbies@freebsd.org
Subject:   Re: dang: how to display the process ass'd with an active port
Message-ID:  <20040218153159.3c421254@localhost.localhost>
In-Reply-To: <20040218200422.75DE916A503@hub.freebsd.org>
References:  <20040218200422.75DE916A503@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> From: "Goodleaf, John M" <jgoodlea@fhcrc.org>
> Subject: dang: how to display the process ass'd with an active port
> 
> Under 4.9, how can I tell which process is associated with a port? I've
> noticed a few oddball ports open on a machine, and I'd like to know which
> process did that. Seems straightforward and yet I don't know the answer.

As root, do
# sockstat -4l

You should see which processes and ports are listening, such as:
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      
garble   xpilots    1587  3  udp4   *:15345               *:*
root     sendmail   449   4  tcp4   127.0.0.1:25          *:*
root     sshd       443   3  tcp4   *:22                  *:*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040218153159.3c421254>