Last active
June 1, 2016 19:15
-
-
Save devboy/be809a16cd0db9bda29410e4d883f1bd to your computer and use it in GitHub Desktop.
SSH connection via local or public ip depending on own ip (on OSX 10.11)
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
# ~/.ssh/config | |
Match originalhost somehost exec "bash -c '[ $(ipconfig getifaddr en0) = 192.168.0.40 ] && exit 0'" | |
HostName 192.168.0.50 | |
Port 22 | |
User user | |
Host somehost | |
HostName somehost.com | |
Port 8022 | |
User user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment