Sunday, February 24, 2013

How to find open ports and PID relation?


[root@client1 ~]# lsof -i
COMMAND     PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
rpcbind    1361     rpc    6u  IPv4   8648      0t0  UDP *:sunrpc
rpcbind    1361     rpc    7u  IPv4   8652      0t0  UDP *:realm-rusd
rpcbind    1361     rpc    8u  IPv4   8653      0t0  TCP *:sunrpc (LISTEN)
rpcbind    1361     rpc    9u  IPv6   8655      0t0  UDP *:sunrpc
rpcbind    1361     rpc   10u  IPv6   8657      0t0  UDP *:realm-rusd
rpcbind    1361     rpc   11u  IPv6   8658      0t0  TCP *:sunrpc (LISTEN)
avahi-dae  1398   avahi   13u  IPv4   8867      0t0  UDP *:mdns
avahi-dae  1398   avahi   14u  IPv4   8868      0t0  UDP *:41861
rpc.statd  1423 rpcuser    5u  IPv4   9169      0t0  UDP *:kerberos_master
rpc.statd  1423 rpcuser    8u  IPv4   9173      0t0  UDP *:56647
rpc.statd  1423 rpcuser    9u  IPv4   9177      0t0  TCP *:44453 (LISTEN)
rpc.statd  1423 rpcuser   10u  IPv6   9181      0t0  UDP *:33861
rpc.statd  1423 rpcuser   11u  IPv6   9185      0t0  TCP *:34178 (LISTEN)
cupsd      1500    root    6u  IPv6   9440      0t0  TCP localhost:ipp (LISTEN)
cupsd      1500    root    7u  IPv4   9441      0t0  TCP localhost:ipp (LISTEN)
cupsd      1500    root    9u  IPv4   9444      0t0  UDP *:ipp
sshd       1619    root    3u  IPv4   9994      0t0  TCP *:ssh (LISTEN)
sshd       1619    root    4u  IPv6   9996      0t0  TCP *:ssh (LISTEN)
master     1699    root   12u  IPv4  10218      0t0  TCP localhost:smtp (LISTEN)
master     1699    root   13u  IPv6  10220      0t0  TCP localhost:smtp (LISTEN)
httpd      1739    root    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
qpidd      1759   qpidd   10u  IPv4  10564      0t0  TCP *:amqp (LISTEN)
sshd      20154    root    3u  IPv4  85260      0t0  TCP client1.unixgeek.com:ssh->192.168.122.1:41754 (ESTABLISHED)
sshd      20154    root    8u  IPv6  85310      0t0  TCP localhost:x11-ssh-offset (LISTEN)
sshd      20154    root    9u  IPv4  85311      0t0  TCP localhost:x11-ssh-offset (LISTEN)
httpd     30172  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
httpd     30173  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
httpd     30174  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
httpd     30175  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
httpd     30176  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
httpd     30177  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
httpd     30178  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
httpd     30179  apache    4u  IPv6  10463      0t0  TCP *:http (LISTEN)
sshd      32503    root    3r  IPv4 104270      0t0  TCP client1.unixgeek.com:ssh->192.168.122.1:44522 (ESTABLISHED)


No comments: