Skip to content

Instantly share code, notes, and snippets.

@jdloft
Created July 24, 2020 17:11
Show Gist options
  • Save jdloft/5e25346c4fb87c75b408bc8ad2d1f404 to your computer and use it in GitHub Desktop.
Save jdloft/5e25346c4fb87c75b408bc8ad2d1f404 to your computer and use it in GitHub Desktop.
Looping ssh forwarding proxy
#!/bin/sh
while :; do
echo "Proxy run"
ssh -NT -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -i $SSH_KEY -R 1234:localhost:22 USER@REMOTE
echo "End loop backoff (30s)"
sleep 30
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment