From owner-freebsd-questions@FreeBSD.ORG Tue Apr 10 07:58:03 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 408F016A402 for ; Tue, 10 Apr 2007 07:58:03 +0000 (UTC) (envelope-from jonathan@hst.org.za) Received: from sirian.hst.org.za (sirian.hst.org.za [209.203.2.130]) by mx1.freebsd.org (Postfix) with ESMTP id E66AB13C46C for ; Tue, 10 Apr 2007 07:57:37 +0000 (UTC) (envelope-from jonathan@hst.org.za) Received: from localhost (localhost.hst.org.za [127.0.0.1]) by sirian.hst.org.za (Postfix) with ESMTP id 74DE736D83A for ; Tue, 10 Apr 2007 09:56:23 +0200 (SAST) Received: from sirian.hst.org.za ([127.0.0.1]) by localhost (sirian.hst.org.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 40008-02 for ; Tue, 10 Apr 2007 09:56:23 +0200 (SAST) Received: from sysadmin.hst.org.za (sysadmin.int.dbn.hst.org.za [10.1.1.20]) by sirian.hst.org.za (Postfix) with ESMTP id 8EAEB36D6A8 for ; Tue, 10 Apr 2007 09:56:22 +0200 (SAST) From: Jonathan McKeown Organization: Health Systems Trust To: freebsd-questions@freebsd.org Date: Tue, 10 Apr 2007 10:00:02 +0200 User-Agent: KMail/1.7.2 References: <461A5D9E.2010501@aeternal.net> In-Reply-To: <461A5D9E.2010501@aeternal.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200704101000.03164.jonathan@hst.org.za> X-Virus-Scanned: by amavisd-new at hst.org.za Subject: Re: command to inentify the process that is listening in a port. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2007 07:58:03 -0000 On Monday 09 April 2007 17:37, Martin Hudec wrote: > Siju George wrote: > > How Do you actually Identify what process is listening on a TCP/IP port? > > "nmap" does not usually give the right answer. > > There should be some command that can be run on the local host for > > identification right? > > man lsof > > 5:35pm [amber] ~# lsof -i @localhost:123 > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME > ntpd 552 root 10u IPv4 0xc4c46000 0t0 UDP localhost:ntp Just out of interest, why do so many people recommend lsof, which is a port, when sockstat/fstat are in the base system and seem to cover the same ground? Am I missing something about lsof? Jonathan