0
I am trying to automate the process of connecting to a Windows machine via RDP and then initiating an ssh tunnel back to the client machine.
The way I currently manually handle this:
I log into the RDP server and run the following command to aid in helping me find the right IP address:
netstat -a | find "3389" | find "ESTABLISHED"
This spits out a line that contains the connection details for my computer's rdp connection. This IP is the IP that the server will be able to route through back to my computer.
I manually open PuTTY and open an existing session that's properly configured with username and key, change the IP appropriately, and click connect.
At this point on my client machine I can now access some resources via the ssh port forwarding.
What I would like to do is figure out some way to automate this. The Microsoft remote desktop client has the ability to launch an program upon connection. What I don't know is what program or combination of programs to run.
The netstat line doesn't result in just a single IP, only one line out netstat output. – mindless.panda – 2012-02-07T00:57:38.003