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

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sat Jun 24 02:46:04 AEST 2017


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

            Bug ID: 2731
           Summary: .ssh/config: Host * overrides included files
           Product: Portable OpenSSH
           Version: 7.5p1
          Hardware: amd64
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: mindrot at ashka.me

Hi,

When a file is included, and that .ssh/config contains a "Host *"
section, properties (like User) that should be overriden in included
files are not.


Reproduction steps:
- Create the following .ssh/config:
Host a
    Hostname a.b.c
    User userA

Host *
    User userB

- `ssh a' should log in to userA at a.b.c, `ssh b.c.d' should log in to
userB at b.c.d'

- Move the `a' host into an included file to have the following
.ssh/config:
Host *
    User userB

Include ~/.ssh/a_host

- `ssh a' will try to log in to userB at a.b.c instead of userA at a.b.c.

Expected result:
  `ssh a' should log in to userA at a.b.c anyway since there is an User
line in its Host definition and that that works when not included.


I have read online that the "Host *" should be at the end of the file,
which works fine in the first example, however in the example with the
Include, doing that "deletes" the included Hosts; having Include then
User would make `ssh a' not work (unresolved hostname), as if there was
no entry.

ssh -V: OpenSSH_7.5p1, OpenSSL 1.1.0f  25 May 2017

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list