December 14, 2021

RDP via Reverse SSH Tunnel

Client A wants to connect server B behind the firewall. We can reverse SSH from B to server C and client A can connect to the open port on server C, traffic will be forwarded to B:3389

plink.exe <user>@<ip or domain> -pw <password> -P 22 -2 -4 -T -N -C -R 0.0.0.0:12345:127.0.0.1:3389

Allow SSH session to allow remote hosts to connect to ports forwarded 

sudo nano /etc/ssh/sshd_config  
GatewayPorts=clientspecified 

Open the port 12345 on the server C

Ref: https://eviatargerzi.medium.com/how-to-access-rdp-over-ssh-tunnel-c0829631ad44


No comments:

Post a Comment