Determining the reverse port tunnels

Cary FitzHugh cary.fitzhugh at
Wed Apr 22 09:43:46 AEST 2015

Hi all,

If I were to connect to a system with a command like this:

ssh -R *:0:localhost:3000 user at server

Is there any way for openssh to tell my shell what ports it opened for me?

i.e. what port on server is my localhost:3000 exposed to?

I know that there is a stderr / stdout printout of the port, but wonder if
there is a way to know in my shell.  Maybe an env var?  Maybe some grepping
of netstat?

Cary FitzHugh

More information about the openssh-unix-dev mailing list