Sharing multiple ssh connections

From Notes_Wiki

Home > CentOS > CentOS 6.x > OpenSSH server configuration > Sharing multiple ssh connections

There is newer article on this at CentOS 8.x SSH client tips and tricks

It is possible that once ssh connection is established with the machine, the same gets used for all additional ssh, scp, rsync etc. connections to remote machine without requiring user to enter password again. For this we need to configure ssh client by adding following configuration in '/etc/ssh/ssh_config' file:

Host *
        ControlMaster auto 
        ControlPath /tmp/%r@%h:%p

Note that sharing connections is property of SSH client and not SSH server.

ControlMaster also takes other parameters like yes, no apart from auto. But if we use yes or not we need to explicitly specify whether this is first connection (Master connection) or slave connection which is not convenient. Hence using auto saves us from having to specify yes or not appropriately for each connection.



Home > CentOS > CentOS 6.x > OpenSSH server configuration > Sharing multiple ssh connections