How can I get list of open SSH tunnels?
I'm using Mac OS X client connected to FreeBSD server. I'm trying to query open tunnels on the client.
How can I get list of open SSH tunnels?
I'm using Mac OS X client connected to FreeBSD server. I'm trying to query open tunnels on the client.
You can use lsof:
The last line represent a tunnel (look at the state LISTEN).
In Ubuntu, with iptables and iptstate installed and standard ssh port:
each line will represent open tunnel.
If you're trying to find out what's using the tunnel(s) in a single
ssh
session, type~#
at the beginning of a line.Using lcipriani's answer in a script: