Mon, 25 Aug 2008

SSH Session Sharing.

Here's a neat trick I got from johnf who got it from jdub who got it from lifeless who according to him "got it from some random post a few years ago".

The trick is for anyone who uses slogin to do multiple logins to a single machine. By adding the following to the ~/.ssh/config file:

  Host *
      StrictHostKeyChecking yes
      ControlMaster auto
      ControlPath ~/.ssh/master-%r@%h:%p

all connections to that machine after the first will share the same initial connection. The big advantage is that for remote machines that are a little slow to log into normally, these shared connections will almost instantaneous.

Johnf tells me that the one caveat is that occasionally if you shut down the first connection the others may hang and its not possible to reconnect until you manually delete the ControlPath file.

Posted at: 18:10 | Category: Tech | Permalink