= [Network] Check Ports in Use == [Unix-like] === [ss] [[[#!Vim sh sudo ss -tulpn ]]] [[[ Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process udp UNCONN 0 0 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=638,fd=13)) udp UNCONN 0 0 0.0.0.0:68 0.0.0.0:* users:(("dhclient",pid=519,fd=9)) udp UNCONN 0 0 0.0.0.0:17500 0.0.0.0:* users:(("dropbox",pid=366138,fd=54)) tcp LISTEN 0 511 0.0.0.0:443 0.0.0.0:* users:(("nginx",pid=2806651,fd=7),("nginx",pid=2806650,fd=7),("nginx",pid=2068522,fd=7)) tcp LISTEN 0 151 0.0.0.0:3306 0.0.0.0:* users:(("mysqld",pid=519580,fd=29)) tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=2806651,fd=6),("nginx",pid=2806650,fd=6),("nginx",pid=2068522,fd=6)) tcp LISTEN 0 128 0.0.0.0:17500 0.0.0.0:* users:(("dropbox",pid=366138,fd=53)) tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1149111,fd=3)) tcp LISTEN 0 511 127.0.0.1:6379 0.0.0.0:* users:(("redis-server",pid=2583586,fd=18)) . . . ]]] === [lsof] [[[#!Vim sh sudo lsof -i -P ]]] [[[ COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dhclient 519 root 9u IPv4 2996 0t0 UDP *:68 systemd-r 638 systemd-resolve 13u IPv4 3060 0t0 UDP localhost:53 systemd-r 638 systemd-resolve 14u IPv4 3061 0t0 TCP localhost:53 (LISTEN) java 18514 ubuntu 451u IPv4 109868774 0t0 TCP localhost:42264->localhost:3306 (ESTABLISHED) java 18514 ubuntu 459u IPv4 109869086 0t0 TCP localhost:52510->localhost:3306 (ESTABLISHED) java 18514 ubuntu 461u IPv4 109869098 0t0 TCP localhost:60694->localhost:3306 (ESTABLISHED) . . . ]]] [[[#!Vim sh sudo lsof -P -i :443 ]]] [[[ COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dropbox 366138 ubuntu 28u IPv4 109869434 0t0 TCP ip-172-31-18-21.ap-northeast-2.compute.internal:39146->162.125.40.2:443 (ESTABLISHED) dropbox 366138 ubuntu 75u IPv4 109869392 0t0 TCP ip-172-31-18-21.ap-northeast-2.compute.internal:45662->162.125.40.1:443 (ESTABLISHED) nginx 2068522 root 7u IPv4 55160814 0t0 TCP *:443 (LISTEN) nginx 2806650 www-data 4u IPv4 109895746 0t0 TCP ip-172-31-18-21.ap-northeast-2.compute.internal:443->196.251.69.133:62339 (ESTABLISHED) nginx 2806650 www-data 5u IPv4 109888542 0t0 TCP ip-172-31-18-21.ap-northeast-2.compute.internal:443->nbl216.ntup.net:52673 (ESTABLISHED) nginx 2806650 www-data 7u IPv4 55160814 0t0 TCP *:443 (LISTEN) nginx 2806650 www-data 15u IPv4 109895761 0t0 TCP ip-172-31-18-21.ap-northeast-2.compute.internal:443->221.147.112.178:62841 (ESTABLISHED) nginx 2806650 www-data 16u IPv4 109894716 0t0 TCP ip-172-31-18-21.ap-northeast-2.compute.internal:443->crawl-66-249-66-71.googlebot.com:53280 (ESTABLISHED) nginx 2806651 www-data 7u IPv4 55160814 0t0 TCP *:443 (LISTEN) . . . ]]]