Last active
March 26, 2019 10:32
-
-
Save leonlaser/ccc4d1a2cf058e78b9109a5936dc1e18 to your computer and use it in GitHub Desktop.
[Forward remote port via ssh to localhost] #ssh #portforwarding #network #bash
This file contains hidden or 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/bash | |
set -o errexit | |
# use -f to run in background | |
ssh $user@$host -NL $localport:localhost:$remoteport | |
echo "Forwarding ${host}:${remoteport} to localhost:${localpost}. (Press ctrl+c to stop)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment