Created
January 18, 2018 19:59
-
-
Save znorris/f00967eccc931557e29a4a92c548d806 to your computer and use it in GitHub Desktop.
SSH Config Notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This config block will check if the current public IP of the host is 8.8.8.8 | |
# If this is true, we can assume we're on the same network as our server, bob. In this case we should use it's local IP. | |
# If this is false, we can assume we're not on the same network as our server, bob. In this case we should use it's public IP. | |
Match OriginalHost bob Exec "curl -s 'https://api.ipify.org?format=text' | grep '8.8.8.8'" | |
Hostname 192.168.1.2 | |
Host bob | |
Hostname 8.8.8.8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment