Difference between revisions of "SSH Multiplexing"

From UFRC
Jump to navigation Jump to search
Line 7: Line 7:
 
Example with SSH key authentication that enables SSH multiplexing. Each subsequent connection resets the idle timeout countdown:
 
Example with SSH key authentication that enables SSH multiplexing. Each subsequent connection resets the idle timeout countdown:
  
Edit the ~/.ssh/config file and add or modify the following entry:
+
Edit the ssh configuration file on your local computer (typically <code>~/.ssh/config</code>) and add or modify the following entry:
 
<pre>
 
<pre>
 
Host hpg
 
Host hpg

Revision as of 15:12, 18 October 2021

If use use a Linux or MacOS computer and your workflow involves making a lot of connections to HiPerGator you may want to use SSH Multiplexing to avoid having to go through MFA for every connection.

In a nutshell, ssh multiplexing works by creating a TCP socket the first time a connection is made. That socket can be used by subsequent connections within the idle timeout period to create new connections without triggering MFA.

See [1] for reference.

Example with SSH key authentication that enables SSH multiplexing. Each subsequent connection resets the idle timeout countdown:

Edit the ssh configuration file on your local computer (typically ~/.ssh/config) and add or modify the following entry:

Host hpg
    User albertgator
    HostName hpg.rc.ufl.edu
    Port 2222
    ControlPath ~/.ssh/cm-%r@%l-%h:%p
    ControlMaster auto
    ControlPersist 8h
If you use username and password remove the Port 2222 line from the configuration.