[Bug 2731] .ssh/config: Host * overrides included files

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Tue Jun 27 13:39:02 AEST 2017


https://bugzilla.mindrot.org/show_bug.cgi?id=2731

--- Comment #5 from Damien Miller <djm at mindrot.org> ---
I can't reproduce that behaviour. With ~/.ssh/config containing:

-----------

Include ~/.ssh/config_a

Host *
        User bar

-----------

... and ~/.ssh/config_a containing:

-----------

Host a
        Hostname 192.168.0.1
        User foo

-----------

I get the following log messages:

> OpenSSH_7.5, LibreSSL 2.6.0
> debug1: Reading configuration data /home/djm/.ssh/config
> debug3: /home/djm/.ssh/config line 1: Including file /home/djm/.ssh/config_a depth 0
> debug1: Reading configuration data /home/djm/.ssh/config_a
> debug1: /home/djm/.ssh/config_a line 1: Applying options for a
> debug1: /home/djm/.ssh/config line 3: Applying options for *
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug2: resolving "192.168.0.1" port 22

This differs from your trace:

> Include then Host *:
> $ ssh -vvv a
> OpenSSH_7.5p1, OpenSSL 1.1.0f  25 May 2017
> debug1: Reading configuration data /home/ashka/.ssh/config
> debug3: /home/ashka/.ssh/config line 64: Including file /home/ashka/.ssh/a_host depth 0 (parse only)

You aren't showing your full ~/.ssh/config file, but I can see that
there are 64 lines of other stuff before it actually gets to the
Include directive.

I bet one of those is another Host or Match line, and the Include is
being made conditional on it. That's what the "(parse only)" means -
that the file is being read and checked for syntax, but its contents
are ignored because it's in a Match/Host statement that didn't match.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list