strange ssh_config inheritance

Christoph Anton Mitterer calestyo at scientia.net
Sat Nov 29 13:09:02 EST 2014


Hi.

I was playing around a bit and noticed the following behaviour which
doesn't seem to match the documentation (which basically says the first
time an option is set, that value is used).

Having the following ~/.ssh/config:
Host foo bar
        HostName        %h.example.org

Host foo.example.org
        User    root
        ControlMaster   auto
        ControlPersist  1h

Host bar.example.org
        User            root
        ControlMaster   auto
        ControlPersist  1h

Host *
        ControlPath     ~/.ssh/control-mux/%l_%r@%h:%p
        ControlPersist  1s

...the following happens when one logs in to foo or bar (without the
domain).


1) Apparently, using HostName works in a way so that ssh_config is
parsed again with the new name, because a socket is actually created.
This behaviour seems to be undocumented, i.e. from the documentation I'd
have expected that logging in to "foo" wouldn't cause the config from
"foo.example.org" be used.
I'd write a patch, but since all my previous pull requests improving the
docs have been ignored even after asking back several times I don't
bother.


2) Since ControlMaster=auto applies to just "foo" or "bar", one would
expect that ControlPersist=1h does so as well. But it doesn't (the 1s is
taken).
As soon as I exit, the mux process quits (after 1s) and the socket gets
removed.
That's not how I'd interpret how inheritance works from the manpage...
is it a bug?

ControlPath in turn is taken up again correctly.


Cheers,
Chris.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5313 bytes
Desc: not available
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20141129/62c752f7/attachment.bin>


More information about the openssh-unix-dev mailing list