Multiplexing allows a single connection to be shared by multiple
SSH sessions. The connection could also be set to persist for a set time and reused for fast re-connection.
Sharing of multiple sessions for
multiplexing could be configured in the user's
SSH client configuration file.
SSHclient configuration file for your user using your preferred text editor.
$ vi ~/.ssh/config
* applies configuration for all hosts. Other possible host options:
example.com *.example.com 192.168.100.10 192.168.100.*
multiplexingfor the selected host(s).
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 [email protected]'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.