Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Most ssh connections I make benefit from the ControlMaster being turned on, for example most of the connections I make over VPN. However, there are a few that don't, such as github. So I've got the following in my ~/.ssh/config file:

Host *
  ControlMaster auto
  ControlPath   ~/.ssh/%r,%h,%p
  ControlPersist 30m

Host github.com
  ControlMaster no
  ControlPath none
  ControlPersist no

(Among other such exceptions)

However, from what I can tell (pgrep -fla mux), the mux process is still being created, and this seems to provide some minor annoyances for the connections that don't benefit from muxing.

Is there some way to specify, on a host-by-host basis, in my config file, not to create the master connection?

share|improve this question
up vote 3 down vote accepted

The first matching parameter applies. Switch the order of the sections.

Host github.com other-exception.example.com
ControlPath none

Host *
ControlMaster auto
ControlPath   ~/.ssh/%r,%h,%p
ControlPersist 30m

This is mentioned in the ssh_config man page, but not very clearly:

For each parameter, the first obtained value will be used. The configuration files contain sections separated by “Host” specifications, and that section is only applied for hosts that match one of the patterns given in the specification.

share|improve this answer

Your Answer


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.