Dynamically allocated port on reverse forward
Joke de Buhr <[email protected]> Tue, 17 Aug 2010 00:19:36 +0200
| Newsgroups | gmane.network.openssh.general |
|---|---|
| Message-ID | <[email protected]> |
hi,
I discovered ssh option of dynamically allocating a port on reverse forwarded
connections (option: -R)
If I invoke ssh this way:
ssh -R 0:localhost:22 remote_ssh_server
ssh prints a debug message like:
Allocated port 40454 for remote forward ....
before it drops to the shell.
Is there a way of querying the allocated port on the remote site to make it
usable within scripts? For example to execute a command via ssh on the origin
site in this case.
signature.asc
(application/pgp-signature, 706 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQG7BAABAwAlBQJMabl4Hhhoa3A6Ly9wb29sLnNrcy1rZXlzZXJ2ZXJzLm5ldAAK CRCWUloJhwFWxghxC/9VeNOpv9Wz21LLH5a/AA0O6UbwPR0vVsAsKE5SitXL117Y YrKA9HWqw2B6zjrbgZcXyeKSxCqimvlppMbCgOuXbsDllOPmRCcQazXsS3ZgCji/ uFmzJbS/vXrYiUOoPX8uP+OoAI9hHLK0/XMcrfZq+YgnI55baMfA1KUPrOLFyBNO ScIqI4qEFqzzyVMlfaiaKWGOa5gt24j9ASVAUBfwseFHZmcUji1iYrJcBv8MPr1y qAdiyVplqZCwHB1kHga371Jvz9q3WE2bq+mqrLuaGbgzF/c1DI5RCchSYDPVSmdJ hiISDU59ul8w6YjIESJUSLRy6GtW2f3CbYxYs7SfyJ07h0/optYj+7jnH6aV+Dku p6LPCTuJ7q07jg+ticmDJQWy7SEHQKdewsX+UHa9wHf3S3DmNEWTlLQKitdBCrkX gkZbksYZXR/nP4opbPK8JRp82tdu2VqZUUY6OPxji/GSzXFyul/Z0we8pKPNwgiF PuJeBLZ4O+ROGWu2Qqs= =AWkc -----END PGP SIGNATURE-----