Skip to content

Instantly share code, notes, and snippets.

@scottrigby
Last active January 31, 2018 15:30
Show Gist options
  • Save scottrigby/776485fd076fa48fc634f75b8672525f to your computer and use it in GitHub Desktop.
Save scottrigby/776485fd076fa48fc634f75b8672525f to your computer and use it in GitHub Desktop.
Peacock ssh config

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:

  1. 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)"
  2. brew install corkscrew

  3. Add this to the top of a new or existing ~/.ssh/config file:

    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
  4. Now you can add simple Host entries 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
@scottrigby
Copy link
Author

scottrigby commented Jan 31, 2018

If/when github-linguist/linguist#3450 is adopted, we can change the GitHub-flavored Markdown codeblock language from sh to ssh-config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment