使用lsof -i
我可以看到在我的服务器上设置了一个反向的ssh隧道:
sshd 1321 remote 8u IPv4 219299 TCP localhost.localdomain:mvs-capacity (LISTEN)
我怎样才能find创build这个隧道的机器的IP地址?
谢谢
lsof -nPp 1321
运行lsof -i | grep 1321
lsof -i | grep 1321
查看pid的其他连接,其中一个应该是创build隧道的机器的ip。
或者你可以使用netstat -a
试试netstat -ntp | grep 1321
netstat -ntp | grep 1321
(用相关进程的pidreplace1321)。 这将允许您查看networking连接。