Created
June 15, 2017 16:12
-
-
Save nicdoye/38aa78f68a9db44d98e2278a4d5b871e to your computer and use it in GitHub Desktop.
SSH tunnel to Windows server in AWS VPC
This file contains 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
#!/bin/bash | |
# SECURITY WARNING: the password will be visible in the process list on your local machine. | |
# Note: you need PuTTY's plink to get this to work, even on macOS | |
# macOS: `brew install putty` | |
# Windows: `choco install putty` | |
# Arguments: | |
# vpc_ip = Private IP Address of the Windows box. e.g. 172.16.1.1 | |
# local_port = whatever port on your local machine you want to use (that you have permissions to use) e.g. 12345 | |
# password = Administrator password (if you create another user, use that) | |
vpc_ip=$1 | |
local_port=$2 | |
password=$3 | |
plink ${vpc_ip} -P 22 -C -L 127.0.0.1:{local_port}:${vpc_ip}:3389 -l Administrator -pw "${password}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment