The under-documented Match keyword with this custom script solves the SSH issue on our VPN or any NBCU Proxy network because 3.3.172.116 will always be resolvable. See the Match section of the sshd_config man page.
Step-by-step for anyone interested:
-
Install Homebrew if you don’t have it. It’s just one line in your terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -
brew install corkscrew -
Add this to the top of a new or existing
~/.ssh/configfile:Match host * exec "ping -t 1 -c 1 3.3.172.116" ProxyCommand /usr/local/bin/corkscrew proxy.inbcu.com 80 %h %p ServerAliveInterval 5 ControlPath ~/.ssh/control-%r ControlMaster auto
-
Now you can add simple
Hostentries for each of your NBCU servers, which will pick up the above options and don’t require strict Host namespacing, complex Host blocks, or ssh config switching when not on the Peacock network:Host tlmd_pr Hostname ec2-XX-X-XX-XXX.compute-1.amazonaws.com User USERNAME
If/when github-linguist/linguist#3450 is adopted, we can change the GitHub-flavored Markdown codeblock language from
shtossh-config.