Skip to content

Instantly share code, notes, and snippets.

@caruccio
Created March 21, 2013 13:12
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 caruccio/5212909 to your computer and use it in GitHub Desktop.
Save caruccio/5212909 to your computer and use it in GitHub Desktop.
Reusing a shared master ssh connection across many ssh client instances (really fast login after first login).
Host my-server # Alias for this server so you can run "$ ssh my-server"
#ForwardAgent yes # Use local agent to password-free authentication
#User my_user # Name of remote user
#IdentityFile ~/.ssh/id_rsa-${MY_SERVER} # I suggest you to use key-pair auth
Hostname my.server.fqdn # Real server hostname
ControlMaster auto # share a single ssh connection across many ssh instances
ControlPersist 60 # send master connection to background, close it if idle for 60 seconds
ControlPath ~/.ssh/master/ssh-%h # place local sharing socket in a secure place
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment