Skip to content

Instantly share code, notes, and snippets.

@ltpitt
Last active June 27, 2017 07:33
Show Gist options
  • 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 [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment