Difference between revisions of "Sharing multiple ssh connections"

From Notes_Wiki
(Created page with "=Sharing multiple ssh connections= It is possible that once ssh connection is established with the machine, the same gets used for all additional ssh, scp, rsync etc. connect...")
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Sharing multiple ssh connections=
[[Main Page|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 '<tt>/etc/ssh/ssh_config</tt>' file:
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 '<tt>/etc/ssh/ssh_config</tt>' file:
Line 11: Line 13:


''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.''
''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.''
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[OpenSSH server configuration]] > [[Sharing multiple ssh connections]]

Latest revision as of 09:43, 14 July 2022

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