使用lsof命令,比如查看sshd这个程序的网络连接使用命令
1
2
3
4
5
6
|
root@debian:~ # lsof -i | grep ^sshd sshd 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) |