Skip to content

Instantly share code, notes, and snippets.

@devboy
Last active June 1, 2016 19:15
Show Gist options
  • Save devboy/be809a16cd0db9bda29410e4d883f1bd to your computer and use it in GitHub Desktop.
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)
# ~/.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