Thinking Out Loud

February 2, 2017

Check Listen Ports

Filed under: linux — mdinh @ 4:21 am

Just playing around.

-t: tcp
-u: udp

$ netstat -tpan

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      -
tcp        0      0 127.0.0.1:6010              0.0.0.0:*                   LISTEN      -
tcp        0      0 127.0.0.1:2016              0.0.0.0:*                   LISTEN      12572/oraagent.bin
tcp        0      0 0.0.0.0:61194               0.0.0.0:*                   LISTEN      -
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      -
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      -
tcp        0     52 192.168.146.11:22           192.168.146.1:64706         ESTABLISHED -
tcp        0      0 ::1:25                      :::*                        LISTEN      -
tcp        0      0 ::1:6010                    :::*                        LISTEN      -
tcp        0      0 :::7901                     :::*                        LISTEN      31565/./mgr
tcp        0      0 ::1:2016                    :::*                        LISTEN      12572/oraagent.bin
tcp        0      0 :::42731                    :::*                        LISTEN      -
tcp        0      0 :::1551                     :::*                        LISTEN      12591/tnslsnr
tcp        0      0 :::111                      :::*                        LISTEN      -
tcp        0      0 :::22                       :::*                        LISTEN      -

$ lsof -i :1551

COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
tnslsnr 12591 oracle    8u  IPv6  31451      0t0  TCP *:hecmtl-db (LISTEN)

$ lsof -i :7901

COMMAND   PID   USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
mgr     31565 oracle   11u  IPv6 1448686      0t0  TCP *:tnos-sp (LISTEN)

$ netstat -tpal

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 localhost:smtp              *:*                         LISTEN      -
tcp        0      0 localhost:x11-ssh-offset    *:*                         LISTEN      -
tcp        0      0 localhost:bootserver        *:*                         LISTEN      12572/oraagent.bin
tcp        0      0 *:61194                     *:*                         LISTEN      -
tcp        0      0 *:sunrpc                    *:*                         LISTEN      -
tcp        0      0 *:ssh                       *:*                         LISTEN      -
tcp        0    852 arrow1.localdomain:ssh      192.168.146.1:64706         ESTABLISHED -
tcp        0      0 localhost:smtp              *:*                         LISTEN      -
tcp        0      0 localhost:x11-ssh-offset    *:*                         LISTEN      -
tcp        0      0 *:tnos-sp                   *:*                         LISTEN      31565/./mgr
tcp        0      0 localhost:bootserver        *:*                         LISTEN      12572/oraagent.bin
tcp        0      0 *:42731                     *:*                         LISTEN      -
tcp        0      0 *:hecmtl-db                 *:*                         LISTEN      12591/tnslsnr
tcp        0      0 *:sunrpc                    *:*                         LISTEN      -
tcp        0      0 *:ssh                       *:*                         LISTEN      -
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: