#Example 1: Local Forwarding
ssh -L *:8081:host:3389 root@gateway -N
This command will listen locally on port 8081 which will forward all connections to host:3389 from the gateway server. This basically lets us access a host or port that only "gateway" can access.
#Example 2: Remote Forwarding
ssh -R *:8081:host:3389 root@gateway -N
This command will listen remotely on port 8081 on the gateway server, which will forward all connections to host:3389 on the local server. This basically lets us remotely access a host or port that only the local server can access.
#Questions
- Does this scale?
- Can we automatically set up the tunnel/forwarding on startup? Maybe http://www.harding.motd.ca/autossh/
- Can we monitor the forwarding?
- Also checkout https://joeyh.name/code/pdmenu/