On Thu, 14 Oct 2010, Bai, Bin wrote:
> Hi, all
> Congratulations for the latest OpenSSH release!
> Currently I'm writing the cases for testing the new feature. But this
new feature is very complex for me:
> Ssh(1) connection multiplexing now supports remote forwarding with dynamic
port allocation and can report the allocated port back to the user:
> LPORT=`ssh -S muxsocket -R0:localhost:25 -O forward somehost
> Can you tell me the way follow which I can basically test the new case on a
Unix system(One connect to itself)?
ssh -Nnf -o ControlMaster=yes -o ControlPath=~/.ssh/_%r@%h:%p somehost
LPORT=`ssh -oControlPath=~/.ssh/_%r@%h:%p -R0:localhost:25 -O forward somehost
echo $LPORT
In practise, you would put the ControlMaster and ControlPort options in
~/.ssh/config and probably use ExitOnForwardFailure=yes and ControlPersist
too.
-d