Skip to content

Instantly share code, notes, and snippets.

@joncardasis
Created December 2, 2016 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joncardasis/8e3ee4ccba5b5ad821b1236a1f136c99 to your computer and use it in GitHub Desktop.
Save joncardasis/8e3ee4ccba5b5ad821b1236a1f136c99 to your computer and use it in GitHub Desktop.
Set SSH Enterprise Proxies
#!/bin/bash
# This program configures your ssh configuration file to
# allow all ssh traffic to pass though a specified proxy.
#Install corkscrew - Enables TCP traffic through a proxy
brew install corkscrew
#Ensure corkscrew was installed
hash corkscrew 2>/dev/null || { echo >&2 "corkscrew was not properly installed from homebrew. Ensure it is properly linked."; exit 1; }
#Add proxy to user's ssh config
# *Change the 35.43.7.20 to your proxy ip and 85 to the proxy port*
cat <<EOT >> ~/.ssh/config
ProxyCommand /usr/local/bin/corkscrew 35.43.7.20 85 %h %p
EOT
# Note: If you'd like the proxy to only apply for a single host the
# following should be output to the config:
# Host 107.107.07.7
# ProxyCommand /usr/local/bin/corkscrew 35.43.7.20 85 %h %p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment