Skip to content

Instantly share code, notes, and snippets.

@hackorama
Last active March 31, 2019 19:22
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 hackorama/5af7bb120feaaea4da6baaf3bda058ff to your computer and use it in GitHub Desktop.
Save hackorama/5af7bb120feaaea4da6baaf3bda058ff to your computer and use it in GitHub Desktop.
ssh config

.ssh/config

Host *
  # select if ssh key should be added to ssh agent
  AddKeysToAgent no
  # only if supported
  IgnoreUnknown UseKeychain
  # select if key pass phrase should be added to key chain
  UseKeychain no
  
Host *-screen
  RequestTTY force
  RemoteCommand screen -d -R

Host h home h-screen
  User dev
  HostName dev.home.net
  IdentityFile ~/.ssh/id_dev.home.net

Host w work w-screen
  User dev
  HostName dev.work.net
  IdentityFile ~/.ssh/id_dev.work.net

Host github.com
  HostName github.com
  User git 
  IdentityFile ~/.ssh/id_github.com

Host github.work.com
  HostName github.work.com
  User git 
  IdentityFile ~/.ssh/id_github.work.com

AddKeysToAgent UseKeychain Meaning Effect
yes yes Store key in ssh agent and key passphrase in key chain Enter passphrase once
yes no Store key in ssh agent but do not store key passphrase in key chain Enter passphrase once for every reboot
no no Do not store key in ssh agent and do not store key passphrase in key chain Enter passphrase everytime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment