Difference between revisions of "Configure OpenSSH to reuse ssh connections"

From wikieduonline
Jump to navigation Jump to search
(→‎Example: Use the hash of `%l%h%p%r` instead so that it works on a shared home directory too.)
 
(11 intermediate revisions by one other user not shown)
Line 1: Line 1:
Configure [[Ssh (OpenSSH client)|ssh client]] ([[OpenSSH]])  to reuse connections:
+
Configure [[Ssh (OpenSSH client)|ssh client]] ([[OpenSSH]])  to reuse connections using <code>[[ControlMaster]], [[ControlPath]] and [[ControlPersist]]</code> directives.
  
Follow the following instructions https://stackoverflow.com/questions/20410252/how-to-reuse-an-ssh-connection and how to use them in https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing <code>([[ControlMaster]])</code>
 
  
  [[ControlMaster]]
+
== Example ==
  [[ControlPath]]
+
  [[ControlMaster]] == auto
  [[ControlPersist]]
+
  [[ControlPath]] [[~/.ssh/]]sockets/%C
 +
  [[ControlPersist]] 36000
  
 
+
== Change log ==
ControlMaster auto
+
[[OpenSSH 4.2]]: September 1, 2005 https://www.openssh.com/txt/release-4.2
ControlPath ~/.ssh/sockets/%r@%h-%p
+
* Added <code>[[ControlMaster]]=auto/autoask</code> options to support opportunistic multiplexing (see the <code>ssh_config</code> manpage for details).
[[ControlPersist]] 36000
 
  
 
== Related terms ==
 
== Related terms ==
 
* <code>[[MaxSessions]]</code>
 
* <code>[[MaxSessions]]</code>
* <code>[[ssh -O stop]]</code>
+
* Stop session [[multiplexing]]: <code>[[ssh -O stop]]</code>
 +
* https://stackoverflow.com/questions/20410252/how-to-reuse-an-ssh-connection
 +
* https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing
 +
* <code>[[pipelining]]</code> in <code>[[/etc/ansible/ansible.cfg]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 19:37, 12 November 2021

Advertising: