1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
#Listenしてるプロセス一覧 [root@linux ~]# lsof -i COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME chronyd 629 chrony 1u IPv4 14157 0t0 UDP localhost:323 chronyd 629 chrony 2u IPv6 14158 0t0 UDP localhost:323 master 1539 root 13u IPv4 17568 0t0 TCP localhost:smtp (LISTEN) master 1539 root 14u IPv6 17569 0t0 TCP localhost:smtp (LISTEN) sshd 18675 root 3u IPv4 59200 0t0 TCP *:ssh (LISTEN) sshd 18675 root 4u IPv6 59202 0t0 TCP *:ssh (LISTEN) sshd 30331 root 3u IPv4 938921 0t0 TCP linux:ssh->gateway:52443 (ESTABLISHED) httpd 30468 root 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30469 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30470 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30471 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30472 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30473 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) #22でListernしてるプロセス [root@linux ~]# lsof -i:22 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sshd 18675 root 3u IPv4 59200 0t0 TCP *:ssh (LISTEN) sshd 18675 root 4u IPv6 59202 0t0 TCP *:ssh (LISTEN) sshd 30331 root 3u IPv4 938921 0t0 TCP linux:ssh->gateway:52443 (ESTABLISHED) #80でListernしてるプロセス [root@linux ~]# lsof -i:80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME httpd 30468 root 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30469 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30470 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30471 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30472 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) httpd 30473 apache 4u IPv6 942095 0t0 TCP *:http (LISTEN) #TCPの22 [root@linux ~]# lsof -iTCP:22 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sshd 18675 root 3u IPv4 59200 0t0 TCP *:ssh (LISTEN) sshd 18675 root 4u IPv6 59202 0t0 TCP *:ssh (LISTEN) sshd 30331 root 3u IPv4 938921 0t0 TCP linux:ssh->gateway:52443 (ESTABLISHED) #UDPの123 [root@linux ~]# lsof -iUDP:123 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ntpd 30774 ntp 16u IPv4 944752 0t0 UDP *:ntp ntpd 30774 ntp 17u IPv6 944753 0t0 UDP *:ntp ntpd 30774 ntp 18u IPv4 944758 0t0 UDP localhost:ntp ntpd 30774 ntp 19u IPv4 944759 0t0 UDP linux:ntp ntpd 30774 ntp 20u IPv6 944760 0t0 UDP localhost:ntp |