~/.ssh/config can contain directives such as Include which result in a configuration state that cannot be found in any single file. `ssh -G [host]` will print out the fully processed config for a particular host, but information such as host wildcards cannot be authoritatively determined through this mechanism. This enhancement request is for a command line parameter that will print the entire configuration after it is loaded. Ideally in a format that could be used as a standalone ~/.ssh/config, and with the contents matching the layout of the original included config files, but some other consistent and machine readable format would still be useful. My use case involves some existing helper scripts that check for the existence of some configuration in ~/.ssh/config. Those scripts cannot see that configuration in my ~/.ssh/configX which is included in my main config, but I also don't want them to search ~/.ssh/* because that would cover files that aren't included or otherwise loaded. As I found myself considering writing my own ssh config preprocessor based on readconf.c I decided this request might be in order. Example: % cat ~/.ssh/config Host foo HostName foo.foo.foo Include configA Include configB % cat ~/.ssh/configA Host bar HostName bar.bar.bar % cat ~/.ssh/configB Host foo User foouser % ssh --print-config-ideal Host foo HostName foo.foo.foo Host bar HostName bar.bar.bar Host foo User foouser % ssh --print-config-acceptable Host foo HostName foo.foo.foo User foouser Host bar HostName bar.bar.bar
What you're asking for does not currently exist with ssh(1) and I don't think adding it would be easy. The current parser builds up what its notion of the "full set" of options based on the arguments it's given, but that full set (the Options struct) is what is output by ssh -G, and it doesn't really have a notion of the "fully expanded" config for all hosts that you're asking for.