查询服务端口
[root@ftp:/root] > lsof -i :22 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sshd 1002 root 3u IPv4 29785 0t0 TCP *:ssh (LISTEN) sshd 1002 root 4u IPv6 29787 0t0 TCP *:ssh (LISTEN) sshd 53109 root 3u IPv4 3697959 0t0 TCP ftp:ssh->192.168.31.126:5831 (ESTABLISHED) [root@ftp:/root] >