Created
May 12, 2024 12:52
-
-
Save mohd-akram/998a241af2a284ffd5580647dbce4a62 to your computer and use it in GitHub Desktop.
Forward a port from a server using SSH
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 | |
# 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