SSH tunnelling: Difference between revisions

Remove -n as implied by -f and not given in further example
(Update compute node forwarding script to pick a random local port with retry (required to support more than one instance on a node))
(Remove -n as implied by -f and not given in further example)
Line 86: Line 86:
<!--T:16-->
<!--T:16-->
<source lang="bash">
<source lang="bash">
ssh GATEWAY -L COMPUTEPORT:LICSERVER:LICPORT -n -N -f
ssh GATEWAY -L COMPUTEPORT:LICSERVER:LICPORT -N -f
</source>
</source>


<!--T:17-->
<!--T:17-->
In this command, the string following the -L parameter specifies the port forwarding information.
In this command, the string following the -L parameter specifies the port forwarding information.
* -n prevents SSH from reading input (it couldn't in a compute job anyway)
* -N tells SSH not to open a shell on the GATEWAY
* -N tells SSH not to open a shell on the GATEWAY
* -f tells SSH to run in the background, allowing the job script to proceed past this SSH command.
* -f tells SSH to run in the background, allowing the job script to proceed past this SSH command (implies -n too).


<!--T:18-->
<!--T:18-->
cc_staff
40

edits