https://bugs.kde.org/show_bug.cgi?id=475638

            Bug ID: 475638
           Summary: using include in ssh config doesn't traverse all
                    includes, only the first
    Classification: Frameworks and Libraries
           Product: kio-extras
           Version: unspecified
          Platform: Manjaro
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: SFTP
          Assignee: plasma-b...@kde.org
          Reporter: something.burner.m...@gmail.com
  Target Milestone: ---

SUMMARY
In order to make my `~/.ssh/` cleaner, I looked for ways to use multiple files
in different folders together. I found Include and then set it all up in a
structured way. When I tested the setup in the terminal to ssh into whatever
host from any included config file, I'm able to connect no issue. When I then
tried to move some files from one ssh host to another in dolphin, using
sftp://, I only got connection to one, the other showed an `Authentication
failed` error.
These two targets are in different files, both included from `~/.ssh/config`.
After some testing, I found out, that only the first Include actually gets
parsed, not any other include in the same file, as when I changed the order of
includes, suddenly the one that initially worked, didn't anymore, while the
other now worked like nothing happened.


STEPS TO REPRODUCE
1. set up the ssh config like so, with your own testing data, having the same
config for both a and b, only with different names, to make it as simple as
possible:

~/.ssh/config:
# start
Include ~/.ssh/a/config
Include ~/.ssh/b/config
# end

~/.ssh/a/config
# start
Host ahost
    HostName 192.168.0.48
    User "root"
    IdentityFile ~/.ssh/a/akey
# end

~/.ssh/b/config
# start
Host bhost
    HostName 192.168.0.48
    User "root"
    IdentityFile ~/.ssh/b/bkey
# end

2. validate both `ssh ahost` and `ssh bhost` work as expected
3. try connection to `sftp://ahost` and `sftp://bhost`
4. reverse the order of includes in `~/.ssh/config`
5. try step 3 again


OBSERVED RESULT
Only the host from the file included first will connect, the other will error
with the following message:
`Failed to resolve hostname bhost (Name or service not known)` (this is from
the initial include order)


EXPECTED RESULT
Both hosts connect without any issue, similar to how the both work using `ssh
host`.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(from the About this System panel)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to