Skip to content

Instantly share code, notes, and snippets.

@tsuyoshicho
Last active April 11, 2018 03:58
Show Gist options
  • Select an option

  • Save tsuyoshicho/8f6d1004e8b0e22278337a9fbc9d5b0a to your computer and use it in GitHub Desktop.

Select an option

Save tsuyoshicho/8f6d1004e8b0e22278337a9fbc9d5b0a to your computer and use it in GitHub Desktop.
# Github
Host github.com
# Alt/Use for Over HTTPS at 443
# Hostname ssh.github.com
# Port 443
Hostname github.com
# gist(use ssh)
Host gist.github.com
# Over HTTPS
# Hostname ssh.github.com
# Port 443
Hostname gist.github.com
# altssh server direct setting
Host ssh.github.com
Hostname ssh.github.com
Port 443
# 2nd or later account
# Example
Host example.github.com
Hostname github.com
# key define : first match check
IdentityFile ~/.ssh/id_rsa.github.example
# github common setting
Match originalhost github.com,gist.github.com,ssh.github.com
IdentityFile ~/.ssh/id_ecdsa.github
IdentityFile ~/.ssh/id_ed25519.github
# fallback
IdentityFile ~/.ssh/id_rsa.github
# github global setting
Host *github.com
User git
TCPKeepAlive yes
IdentitiesOnly yes
Compression yes
# Note:key
# https://api.github.com/users/tsuyoshicho/keys
$ ssh -G [email protected]
user git
hostname github.com
<中略>
identityfile ~/.ssh/id_rsa.github.example
identityfile ~/.ssh/id_ecdsa.github
identityfile ~/.ssh/id_ed25519.github
identityfile ~/.ssh/id_rsa.github
<後略>
# operation server
Host op.example.com
User tsuyoshicho
TCPKeepAlive yes
IdentitiesOnly no
PubkeyAuthentication no
ProxyCommand none
# server instance
Host dev1.example.com
Hostname [2001:db8::1]
User tsuyoshicho
TCPKeepAlive yes
# key define : first match check
IdentityFile ~/.ssh/id_rsa.example
IdentitiesOnly yes
ProxyCommand none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment