From owner-freebsd-newbies@FreeBSD.ORG Wed Feb 18 15:32:26 2004 Return-Path: Delivered-To: freebsd-newbies@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F83116A50F for ; Wed, 18 Feb 2004 15:32:26 -0800 (PST) Received: from localhost.localhost (ca-dibar-cuda1-c10a-39.anhmca.adelphia.net [24.54.234.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFF2943D1F for ; Wed, 18 Feb 2004 15:32:25 -0800 (PST) (envelope-from admin@znode.org) Received: from localhost.localhost (localhost.localhost [127.0.0.1]) by localhost.localhost (8.12.10/8.12.10) with SMTP id i1INW4Aa001638 for ; Wed, 18 Feb 2004 15:32:20 -0800 (PST) (envelope-from admin@znode.org) Date: Wed, 18 Feb 2004 15:31:59 -0800 From: James Wu To: freebsd-newbies@freebsd.org Message-Id: <20040218153159.3c421254@localhost.localhost> In-Reply-To: <20040218200422.75DE916A503@hub.freebsd.org> References: <20040218200422.75DE916A503@hub.freebsd.org> Organization: Znode Productions X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: dang: how to display the process ass'd with an active port X-BeenThere: freebsd-newbies@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Gathering place for new users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 23:32:26 -0000 > From: "Goodleaf, John M" > 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 *:*