Use SOCKS5 with a Dynamic Tunnel
Create a dynamic ssh tunnel to the first machine. Then, use first connection as a SOCKS5 proxy to get to the second host on the remote network.
This is easy to setup via putty. You can reuse the proxy as many time as you like. Some programs support SOCKS5 directly. Like putty and ssh.
Under Linux, proxychains can be used to proxify programs that don't support SOCKS5 natively. Under Windows, I like Proxycap. It works well with RDP.
To set this up using Putty:
In the first host settings page, under tunnels:
- create a dynamic tunnel
- Set the port to 9050.
- Leave the destination part blank, as it's dynamic.
- Save your settings. (Done from the session page.)
Then, in the configuration for the second host, under proxy:
- Select SOCK55.
- Change the proxy host name to 127.0.0.1
- Set the port to 9050
- Then setup the rest of your session as normal
- Save your settings
To connect to the second host. You'll first have to connect and login to the first host. Then you should be able to connect to the second host via the proxified ssh connection,
You can also do this from the command line with an ssh_config entry: