Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

If you ever used ssh shared connection you may also encounter the:

Shared connection to <hostname> closed.

Now, my question is if there is a way that would allow you to benefit from the speedup of using shared ssh connections that would not close your connection when the first ssh session is closed.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes. Use ControlPersist. For example, my ~/.ssh/config looks like this:

Host *
  ControlMaster auto
  ControlPath ~/.ssh/control/%r@%h:%p
  ControlPersist 3600

(if you use this, you'll need to create the directory ~/.ssh/control)

Using this, shared connections stay open and get reused.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.