How can I trick ssh to connect using different configurations based on current location?
- by Sorin Sbarnea
Here is the following use case: wanting to ssh server1 in 3 scenarios:
server1 is on current network, go for it
server1 is not on current network and you need to use a gateway (gw1) to access it, not a big problem as you can use ~/.ssh/config to define tunnelling for this
you are on a network that does not allow you to access the first gw1, so you'll use gw2 for that.
Desired outcome: be able to use the same command and be able to connect to the server.