Skip to content

Instantly share code, notes, and snippets.

@zhiguangwang
Last active December 22, 2020 02:15
Show Gist options
  • Save zhiguangwang/e693c18bc6aa9676106d1f8b209b21ef to your computer and use it in GitHub Desktop.
Save zhiguangwang/e693c18bc6aa9676106d1f8b209b21ef to your computer and use it in GitHub Desktop.
SSH Tunnelling
ssh-tunnel() { nohup ssh -o ServerAliveInterval=15 -f -N -L ${1}:${2} ${3} > /dev/null 2>&1; }

Usage

ssh-tunnel <local-port> <remote-host>:<remote-port> <bastion>

Example

ssh-tunnel 8080 127.0.0.1:8080 [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment