ポートを開いているプロセスを特定する(Linux)

TCPおよびUDPポートを占有しているプロセスを特定する方法を示す。


[root@localhost ~]# netstat -nap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PI
D/Program name
tcp        0      0 0.0.0.0:961                 0.0.0.0:*                   LISTEN      24
75/rpc.statd
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      24
50/portmap
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      27
49/cupsd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      27
81/sendmail: acce
tcp        0      0 :::22                       :::*                        LISTEN      27
38/sshd
tcp        0    148 ::ffff:192.168.201.129:22   ::ffff:192.168.201.1:3255   ESTABLISHED 31
42/1
udp        0      0 0.0.0.0:955                 0.0.0.0:*                               24
75/rpc.statd
udp        0      0 0.0.0.0:958                 0.0.0.0:*                               24
75/rpc.statd
udp        0      0 0.0.0.0:68                  0.0.0.0:*                               23
64/dhclient
udp        0      0 0.0.0.0:5353                0.0.0.0:*                               28
96/avahi-daemon:
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               24
50/portmap
udp        0      0 0.0.0.0:36469               0.0.0.0:*                               28
96/avahi-daemon:
udp        0      0 0.0.0.0:631                 0.0.0.0:*                               27
49/cupsd
udp        0      0 :::51878                    :::*                                    28
96/avahi-daemon:
udp        0      0 :::5353                     :::*                                    28
96/avahi-daemon:
...

>

コメント