Created
July 24, 2020 17:11
-
-
Save jdloft/5e25346c4fb87c75b408bc8ad2d1f404 to your computer and use it in GitHub Desktop.
Looping ssh forwarding proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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