Skip to content

Instantly share code, notes, and snippets.

@nicdoye
Created June 15, 2017 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicdoye/38aa78f68a9db44d98e2278a4d5b871e to your computer and use it in GitHub Desktop.
Save nicdoye/38aa78f68a9db44d98e2278a4d5b871e to your computer and use it in GitHub Desktop.
SSH tunnel to Windows server in AWS VPC
#!/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