SSH tunnelling: Difference between revisions

Update compute node forwarding script to pick a random local port with retry (required to support more than one instance on a node)
No edit summary
(Update compute node forwarding script to pick a random local port with retry (required to support more than one instance on a node))
Line 121: Line 121:


<!--T:23-->
<!--T:23-->
ssh nia-gw -L 9999:licenseserver.institution.ca:9999 -N -f
REMOTEHOST=licenseserver.institution.ca
export MLM_LICENSE_FILE=9999@localhost
REMOTEPORT=9999
LOCALHOST=localhost
for ((i=0; i<10; ++i)); do
  LOCALPORT=$(shuf -i 1024-65535 -n 1)
  ssh nia-gw -L $LOCALPORT:$REMOTEHOST:$REMOTEPORT -N -f && break
done || { echo "Giving up forwarding license port after $i attempts..."; exit 1; }
export MLM_LICENSE_FILE=$LOCALPORT@$LOCALHOST


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

edits