I use a lot of ssh. In fact, I’d consider myself an sshista with how much time I spend ssh’ed to different computers- and I’m by no means special in this regards. In this, the ControlMaster option enables piggybacking multiple shells on top of a single connection. That’s incredibly useful. When you make your first connection, that sets up a control file and any future connections to that remote host simply make use of the original connection for SUPER AWESOME MEGA FAST connections. Sweet!
The Problem
ControlMaster has a severe drawback however- once the master connection is closed, all the other shells piggy-backing off of it close with it. This is what we in the industry call a “bummer”.
The Solution
There’s pages and pages and pages describing ControlMaster, but scant few describing how to correct for the big nasty drawback; and the only one that does seems like a bit of a hack. After a bit of reading the ssh_config man page, I stumbled across ControlPersist. I set that to 120 seconds, and now my ssh connection wil stay alive for two minutes after I close the last connection using it. Huzzah!
One Comment
Hm. My ssh doesn’t have ControlPersist. Looks like it’s time to upgrade to Slack 13.37.
Post a Comment