Multiplexing allows a single SSH connection to be shared by multiple sessions. The connection could be set to persist for a specified time even if you have already logged out from the SSH server and then reused for fast reconnection to the server.
Reconnecting to an SSH server with an already established session does not require reauthentication. It speeds up operations that require multiple SSH connections to a single server, usually when automating tasks via SSH.
Related: How to speed up SSH authentication
You can use multiplexing and share or reuse your SSH connection by configuring your SSH client. It does not require any configuration on the server.
$ vi ~/.ssh/config
* applies configuration for all hosts. Other possible host options:
example.com *.example.com 192.168.100.10 192.168.100.*
host * controlmaster auto
host * controlmaster auto controlpersist 10m
host * controlmaster auto controlpersist 10m controlpath ~/.ssh/muxmasters/%C
Create folder if doesn't exist.
$ mkdir -p ~/.ssh/muxmasters
$ ls ~/.ssh/muxmasters
$ ssh 192.168.111.159 -- hostname firstname.lastname@example.org's password: remotehost
$ ls ~/.ssh/muxmasters 598a7155ff90f076057fb265730c6ffe5997d4bb
$ ssh 192.168.111.159 -- hostname host
Should be without password and very fast as long as you log in again within the controlpersist time value.
Comment anonymously. Login not required.