+++ title = "Reusing SSH connections" description = "Reusing connections makes it easier to use multiple terminals" weight = "37" +++ To reduce the number of times it is necessary to enter your credentials, it's possible to reuse a single SSH connection for multiple terminal instances. ## Mac/Linux 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, subsequent terminals can use that connection, eliminating the need to enter the username and password each time for every connection.  To enable this feature, add the following lines to your `~/.ssh/config `file: {{% panel header="`~/.ssh/config`"%}} {{< highlight bash >}} Host * ControlMaster auto ControlPath /tmp/%r@%h:%p ControlPersist 2h {{< /highlight >}} {{% /panel %}} {{% notice info%}} You may not have an existing `~/.ssh/config.` If not, simply create the file and set the permissions appropriately first: `touch ~/.ssh/config && chmod 600 ~/.ssh/config` {{% /notice %}} This will enable connection reuse when connecting to any host via SSH or SCP.   ## Windows (PuTTY) To enable connection reuse in PuTTY, enable the "Share SSH connections if possible" option under the "SSH" configuration section. First, select the saved PuTTY config for the cluster and click "Load". {{< figure src="/images/putty_share_connection1.png" height="450" >}} Next, select the "SSH" configuration category. Then check the "Share SSH connections if possible" checkbox. {{< figure src="/images/putty_share_connection2.png" height="450" >}} Return to the sessions screen by selecting "Session" at the top and click "Save" to save the settings for future sessions. {{< figure src="/images/putty_share_connection3.png" height="450" >}}