OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Ian H. Greenhoe (ian_at_popcap.com)
Date: Thu Oct 10 2002 - 02:45:23 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Hantzley (hantzleyintnet.mu) spake thus:
    >Hi,
    > Is there a way to know to which process belong a particular port? >e.g.,
    >port 32773 - 32779, are known to be for rpc services. But to which process
    >do they pertain to, that's another issue?
    >
    > Your comments and ideas are the most welcome.

    As root, do:

    netstat -anp

    Parameters as follows:

    -a : show me all connections

    -n : don't bother looking up DNS records (I don't wanna wait for
         DNS to time out multiple times)

    -p : show me the process ID that is connected to port in question

    Why you need to be root: netstat considers it a security violation to
    know about anybody else's [different UID] port / process connections.
    I agree with this, although it can be a royal PITA at times.

    BTW: netstat vs. lsof:

    netstat is more likely to be installed than lsof, and only shows relevant
    items when you are wondering about net connections to process IDs.

    If you do want to use lsof in this instance, grep Is Your Friend.
    However, lsof is a handy util that I recommend that anybody install
    and gain familiarity with. As mentioned recently here, lsof +L1 is
    a wonderous command -- it shows you open files that have been deleted.
    Very useful after you've done an apt-get upgrade. And that's just
    one of its myriad of useful applications.

    Ian Greenhoe

    -- 
    To UNSUBSCRIBE, email to debian-security-requestlists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmasterlists.debian.org