Skip to content

Instantly share code, notes, and snippets.

@dcadenas
Created August 8, 2014 20:30
Show Gist options
  • Save dcadenas/14bc41addce3a60f9f8e to your computer and use it in GitHub Desktop.
Save dcadenas/14bc41addce3a60f9f8e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
[[ $# -gt 0 ]] || { echo "Usage: $(basename $0) remoteport localport"; exit 1; }
autossh -M 0 -v -nNT4 -o "TCPKeepAlive no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 1" -o "ExitOnForwardFailure yes" -R $1:localhost:$2 vps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment