SSH Tunnel to Virtual Machine connected to VPN

sshssh-tunnelvpnwindows-server-2008windows-server-2012

I have a VM running Windows Server 2012 that is used by our dev team to test the application they are working on. Every developer has its own VM and this VM must be connected to a VPN to access some services (like TFS). The VM have a SSH service running that the developers use to control the application server app state (start, reset, etc).

The problem is that developers use the TFS for source code management and for activity tracking, and they complain that they must use the VM to access their tasks in TFS due to the VPN (note: the VPN client cannot be installed in the host machine due to company policies).

I would like to create a tunnel from the host machine to the guest machine (vm), in order to access the TFS website (something like https://TFSServerOverVPN:8080/ProjectX) over vpn:

HOST Machine –> Putty SSH-Tunnel –> VM –> VPN –> TFS Server Web Site

Is it even possible? Are there other options to archive this?

Thanks!

Best Answer

Plink might be easier to configure than PuTTY.

plink -vCNL 127.0.0.1:8080:addressOfTFSServerOverVPN:8080 -l userNameInVM addressOfVM

You may use -pw or -i options to skip inputting password, and run plink.exe directly in cmd to check other options.

Than the access to https://127.0.0.1:8080/ProjectX will be forwarded to https://TFSServerOverVPN:8080/ProjectX.

PS: If TFSServerOverVPN is a virtual host, you might need to bind 127.0.0.1 to TFSServerOverVPN in the hosts file of HOST Machines.