Reusing SSH Conections
ControlMaster is a new feature in OpenSSH v 4.x, that allows it to reuse an existing connection to a remote host when opening new connections to that host
Using this feature you can increase performance as it result into the reduced connection times that the ControlMaster feature provides are particularly nice when you’re using tools that open multiple SSH connections to do work on a remote server…
$ man ssh_config
Enables the sharing of multiple sessions over a single network connection. When set to “yes” ssh will listen for connections on a control socket specified using the ControlPath argument.
Specify the path to the control socket used for connection sharing as described in the ControlMaster section above or the string “none” to disable connection sharing. In the path, ‘%h’ will be substituted by the target host name, ‘%p’ the port and ‘%r’ by the remote login username. It is recommended that any ControlPath used for opportunistic connection sharing include all three of these escape sequences
Read man page for more details ( leia a página de manual para maiores informações )
$ cat .ssh/config
$ ssh 10.1.1.1
Close conection and reopen a see with your eyes the diference !
TIP: The line Host can be:
Host 10.1.1.1 10.1.1.2
The configuration will apply only to hosts .1 and .2 you can do the follow:
This will apply to host between 1 and 9
Follow the video :