dufault.info

Ramblings of a phone weenie, Linux sysadmin, and other things geeky

Making SSH connections to your frequent remote hosts faster with ControlMaster

I recently learned of a newish OpenSSH feature, a feature that let’s you reuse existing SSH connections.
If you want to enable this functionality on a per-host basis, then you can setup your ~/.ssh/config file like this:
Host *
ControlMaster no
ControlPath ~/.ssh/master-%l-%h-%p-%r.sock
Host someserver
Compression yes
ControlMaster yes
To enable it:
ssh -f -N someserver
After that, just ssh in like you would normally:
ssh [...]