1. intro
The concept is very simple — rather than each new SSH connection to a particular server opening up a new TCP connection, you instead multiplex all of your SSH connections down one TCP connection.
The authentication only happens once, when the TCP connection is opened, and thereafter all your extra SSH sessions are sent down that connection.
2. configuration
vi /etc/ssh/ssh_config.d/cid.conf
#
StrictHostKeyChecking no
Ciphers aes128-ctr
# on the server: sshd -T | grep ciphers
# on the client: ssh -Q cipher
ControlMaster auto
ControlPath /tmp/ssh-%r@%h-%p
ControlPersist 24h
3. testing
cid-conn-test
. mkdir dummy
. put file
. rsync dir
. del file and dummy
. elapsed time: 7097 <<<<<<<<<<
cid-conn-test
. mkdir dummy
. put file
. rsync dir
. del file and dummy
. elapsed time: 1635 <<<<<<<<<<
file /tmp/ssh*
/tmp/ssh-cidusr@d01cid.ddns.net-22: socket
/tmp/ssh-root@d01cid.ddns.net-22: socket