From owner-freebsd-questions@FreeBSD.ORG Wed Apr 11 18:52:06 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 0F43E16A407 for ; Wed, 11 Apr 2007 18:52:06 +0000 (UTC) (envelope-from fbsdlists@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.234]) by mx1.freebsd.org (Postfix) with ESMTP id C7A8913C43E for ; Wed, 11 Apr 2007 18:52:05 +0000 (UTC) (envelope-from fbsdlists@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so280495wxc for ; Wed, 11 Apr 2007 11:52:05 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HshRErWz+ATY2LFgItEpqh2EG8fRESJpijq7kyXD0of/BfQFPJRTWrNAZYpf802KFyTh8sRCvstiR/hjRlh5Vy/w56lAUJ7mEjqiErmTRe0qvoVITZkTeULsUXcOlAvNd2CTPiiJjDXjWryACGzL1OGrpjLvTXXD2zBg1OfVtoI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gABJ7R3Fe35UHidAr0Tc+lbLqJnK20mzf5kAffvQe/sMQfu5UXQt4CMsRFxjuqqcgDu3Y2+k9x3aFbqn2S03z1bfxR/zYEyzJmA8fMR3l+kZoO81qhfufJUBmHMZL71KzFRBxTZXV/nRVjq5F6MqCBUg4BN8w3XN8vA6AXdZxrQ= Received: by 10.100.164.14 with SMTP id m14mr705090ane.1176317524981; Wed, 11 Apr 2007 11:52:04 -0700 (PDT) Received: by 10.100.250.9 with HTTP; Wed, 11 Apr 2007 11:52:04 -0700 (PDT) Message-ID: <54db43990704111152w13707e45n1e0b6f436b69dc51@mail.gmail.com> Date: Wed, 11 Apr 2007 14:52:04 -0400 From: "Bob Johnson" To: "Jonathan McKeown" In-Reply-To: <200704101000.03164.jonathan@hst.org.za> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <461A5D9E.2010501@aeternal.net> <200704101000.03164.jonathan@hst.org.za> Cc: freebsd-questions@freebsd.org 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: Wed, 11 Apr 2007 18:52:06 -0000 On 4/10/07, Jonathan McKeown wrote: > 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? Linux systems don't have sockstat, so people who got to FreeBSD via Linux are used to lsof and they tend to continue using it. Same result for those who read the many Linux howto websites. - Bob