To make it more convenient for users who use multiple terminal sessions simultaneously, SSH can reuse an existing connection if connecting from Linux or Mac. After the initial login, additional subsequent terminals can use that connection, eliminating the need to enter the username and password each time for every additional terminalconnection. To enable this feature, add the following lines to your
Host * ControlMaster auto ControlPath /tmp/%r@%h:%p ControlPersist 2h
You may not have an existing
This will enable connection reuse when connecting to any host via SSH or SCP.
Please note that if you terminate the original session, all other sessions using the connection will be terminated as well.