hackerschoice / segfault

357 stars 41 forks source link

example for ssh remote port forward via reverse proxy #40

Closed SkyperTHC closed 2 years ago

SkyperTHC commented 2 years ago

question by Matthias Kesenheimer:

User likes to tunnel the reverse port back to his workstation using ssh -R50334:127.0.0.1:8000.

this needs better explaining and some development to make this neat.

  1. the sshd is running on a different cgroup and different name space. Thus the 50334 wont listen on 'his' root-server but inside the sshd container.
  2. We could have a novel hook inside SSHD to redirect the reverse port directly into the SSHD's 50334.

Equally better example is needed for -L forwards. Forwarding to -L127.0.0.1 will not forward to user's local host but to sshd's name space. Thus user needs to -L10.11.0.xx (use the IP of his workstatation).

SkyperTHC commented 2 years ago

Thsi is now part of the FAQ. thanks for reporting. https://www.thc.org/segfault/faq