Skip to content

Instantly share code, notes, and snippets.

@MakiseKurisu
Last active April 5, 2020 22:25
Show Gist options
  • Save MakiseKurisu/764630551ddb850b0975b0b76f678fea to your computer and use it in GitHub Desktop.
Save MakiseKurisu/764630551ddb850b0975b0b76f678fea to your computer and use it in GitHub Desktop.
SSH Tunnel
# Scenario
# You have control of one computer <remote_address> behind NAT and its public internet facing router <sshd_address>.
# You want to access them from another computer <local_address> that is behind another uncontrolled NAT,
# and also from <remote_address> to this <local_address>.
# Run following command in <local_address>.
# Enable sock5 proxy and allow remote access of local RDP
ssh -R 0.0.0.0:2222:127.0.0.1:3389 -D 8765 -N <sshd_address>
# Access remote SSH and another computer's RDP
ssh -L 2222:<remote_address>:3389 <sshd_address>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment