Skip to content

Instantly share code, notes, and snippets.

@xtex404
Last active March 24, 2023 15:28
Show Gist options
  • Select an option

  • Save xtex404/3a118e490af534e26a89 to your computer and use it in GitHub Desktop.

Select an option

Save xtex404/3a118e490af534e26a89 to your computer and use it in GitHub Desktop.
SSH configuration snippet for github via SSH
#
# SSH configuration snippet to enable SSH tunneling to github.com via
# port 443. Turns off all unnecessary SSH protocols extensions that slow
# things down or break things. In order to prevent SSH key leakage (which
# isn't dangerous, since it's just your public key, but it's still better
# if it didn't leave the network), this configuration will only use the
# SSH key specified on the "Identity" line.
#
# To use this gist: modify the "Identity" line to point to your SSH
# private key. In order to keep ssh from making git very angry, you should
# be using ssh-agent to handle your passphrase or have a keypair without
# a password on it.
#
# Note: make sure you understand how SSH parses config files. It does it
# in a really awful way (in my opinion) and can really screw you up if you
# aren't aware of it. It applies the *last* option found after it parses
# through all host entries (~/.ssh/config and then /etc/ssh/ssh_config).
# Host-specific declarations should be given near the beginning of the
# file, and general defaults at the end. Watch for wildcards. They bite.
#
# Works with OpenSSH 6.6+
#
Host github.com *.github.com
AddressFamily inet
CheckHostIP yes
Compression yes
ControlMaster no
ForwardAgent no
ForwardX11 no
ForwardX11Trusted no
GSSAPIAuthentication no
Hostname ssh.github.com
IdentitiesOnly yes
IdentityFile ~/.ssh/github_2015
Port 443
StrictHostKeyChecking ask
TCPKeepAlive yes
User git
VisualHostKey no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment