眼眸繁星
使用lsof命令,比如查看sshd这个程序的网络连接使用命令123456root@debian:~# lsof -i | grep ^sshdsshd 619 root 3u IPv4 19587 0t0 TCP *:ssh (LISTEN)sshd 619 root 4u IPv6 19589 0t0 TCP *:ssh (LISTEN)sshd 950 root 3u IPv4 21717 0t0 TCP 192.168.71.128:ssh->172.30.0.130:9475 (ESTABLISHED)sshd 52010 root 3u IPv4 126392 0t0 TCP 192.168.71.128:ssh->172.30.0.130:2048 (ESTABLISHED)sshd 53918 root 3u IPv4 142664 0t0 TCP 192.168.71.128:ssh->172.30.0.130:50752 (ESTABLISHED)