Created
March 11, 2010 20:28
-
-
Save konobi/329608 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In .ssh/config: | |
Host * | |
ControlMaster no # Connections by default are not a master | |
ControlPath ~/.ssh/master-%r@%h:%p | |
ServerAliveInterval 60 | |
ServerAliveCountMax 60 | |
# On normal connections, if there is no master running on the ControlPath it will behave as normal | |
ssh some.host | |
# Run autossh (ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/autossh-1.4b.tar.gz) | |
autossh -f -M 0 -N -o "ControlMaster yes" some.host | |
# This will setup a daemon that will maintain a "Master" connection to some.host | |
# Now ssh will use that master channel to connect to some.host | |
ssh some.host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment