Commit 3a3bf822 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

jupyter: support older versions of ssh

parent 437e3a3e
......@@ -283,15 +283,22 @@ function open_tunnel () {
if [[ -n ${SJ_ACCTCODE} ]]; then
# Tunnel to notebook in job needs jump host since nodes
# usually have no direct external access.
# Unfortunately, doesn' seem to support connection sharing
# for the jump host
ssh -o ForwardX11=no \
-o StrictHostKeyChecking=accept-new \
-J "${SJ_USERNAME}@${SJ_FRONTEND_HOST}" \
-L "${port}:localhost:${port}" \
-Nf \
"${SJ_USERNAME}@${node}"
# usually have no direct external access. Unfortunately, ssh
# doesn't seem to support connection sharing for the jump host
if ! ssh -o ForwardX11=no \
-o StrictHostKeyChecking=accept-new \
-J "${SJ_USERNAME}@${SJ_FRONTEND_HOST}" \
-L "${port}:localhost:${port}" \
-Nf \
"${SJ_USERNAME}@${node}"; then
echo "Please consider updating your local ssh client!"
ssh -o ForwardX11=no \
-o StrictHostKeyChecking=no \
-o ProxyCommand="ssh ${SJ_USERNAME}@${SJ_FRONTEND_HOST} nc ${node} 22" \
-L "${port}:localhost:${port}" \
-Nf \
"${SJ_USERNAME}@${node}"
fi
else
ssh_frontend "" "-O forward -L${port}:localhost:${port}"
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment