Last active
November 24, 2016 20:55
-
-
Save saivert/4d82439f33423853a06289d9bf5ef979 to your computer and use it in GitHub Desktop.
RDP tunneled over SSH on bash on windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Fire up bash on windows to run our ssh client with port forwarding and a master control socket | |
REM using /b to background the task | |
start /b bash.exe -c "ssh -N -L127.0.0.1:3390:10.0.0.8:3389 -M -S ~/.rdp-ssh.socket [email protected]" | |
REM start RDP client and wait for it to close | |
start /wait mstsc.exe /v:127.0.0.1:3390 | |
REM send stop signal to our ssh client | |
bash.exe -c "ssh -O stop -S ~/.rdp-ssh.socket [email protected]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment