with OpenSSH 7.3p1 and up where is the option of structuring the ~/.ssh/config a bit more, using the “Include”-Option https://superuser.com/a/1142813
Since having to access servers with different purposes, I’d like to share different parts of my ssh config file with different colleagues. This include option is something I really waited for.
Unfortunately OpenSSH on opensuse (both LEAP 42.3 and tumbleweed) is still at 7.2p2.
I’m reluctant to use any other SSH package than the ones provided by the main repos.
Who knows about the roadmap of OpenSSH versions to be used within opensuse? The newest version is 7.5.p1 released in March this year.
You haven’t got a sample of a Feature Request available by any chance, have you?
I couldn’t figure out how to mark the (bug) report as Feature Request and I’m reluctant to enter it as a bug report. All I could do is maybe prepend Feature Request to the title.
Creating a ~/.ssh/config file with “Include”-statements works flawelessly.
Even autocompletion of hostnames specified in the included config files works. Although I haven’t found out how this is being achieved. I haven’t found any trace of it in /etc/bash_completion.d/ .
In case, someone is able to enlighten me, I would be grateful.
Thanks, I’ve found the scripts for (Tab) completion in “/usr/share/bash-completion/completions” too in the meantime.
Searching through same scripts I could find the mentioning of “HostName” as well e.g. in the scripts named “ssh”, “autossh” and some others.
For me, it seems there is quite a bit of magic going on.
For now, I do not need to understand all the details but I would love to find some pointer how the complete mechanism is traversing through the config files included in the main config.
My main config (~/.ssh/config) looks like this
Include config_service1
Include config_service2
config_service1
Host svc1test
HostName box233
User ....
$ssh svc1t<TAB>
is working. (Even though, svc1test is not included in know_hosts yet or anywhere else). The only place the completion mechanism can pick up the host’s name is from the included config file. That’s great. But where is the magic located?
I peeked around a bit. There are no bash-completion scripts in openssh (either 7.2p2 or 7.6). But there is /usr/share/bash-completion/completions/ssh, which belongs to the package bash-completion-2.1 (on my system = Leap 42.3).
In there is a call for _known_hosts_real. That is a function located in /usr/share/bash-completion/bash_completion. Alas, no ssh include files magic in there.