Skip to content

Instantly share code, notes, and snippets.

@mohd-akram
Created May 12, 2024 12:52
Show Gist options
  • Save mohd-akram/998a241af2a284ffd5580647dbce4a62 to your computer and use it in GitHub Desktop.
Save mohd-akram/998a241af2a284ffd5580647dbce4a62 to your computer and use it in GitHub Desktop.
Forward a port from a server using SSH
#!/bin/sh
# usage: forward host port [localport]
forward() {
ssh -NL ${3-$2}:localhost:$2 $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment