Skip to content

Instantly share code, notes, and snippets.

@ltpitt
Last active June 27, 2017 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ltpitt/754df331bdd4fd2e36a218ffd8113f84 to your computer and use it in GitHub Desktop.
Save ltpitt/754df331bdd4fd2e36a218ffd8113f84 to your computer and use it in GitHub Desktop.
Reverse tunnel ssh on Linux
#!/bin/sh
# Forward only to loopback interface of the server
ssh -fN -R 10022:CLIENTIPTOFORWARD:22 SERVER
# Forward to all interfaces
# In this case it is mandatory to add
# GatewayPorts yes
# to /etc/ssh/sshd_config
ssh -R \*:3389:WINDOWSCLIENT:3389 -N root@yourserver.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment