Last active
January 22, 2017 12:09
-
-
Save adsurbum/3cd4f1132c35de92e859 to your computer and use it in GitHub Desktop.
ssh tunnel (proxy)
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
ssh -fN -L \*:27017:localhost:27017 remote | |
Forward from port 80 to 8081 (every request to port 80 will be transfered to 8081) | |
sudo ssh -L 80:localhost:8081 adsurbum@localhost |
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8081
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8081
another option
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-f for "fork into background" and -N for "run no command"