[Bug 3519] New: Command line parameter to print out full config
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Wed Jan 11 07:59:49 AEDT 2023
https://bugzilla.mindrot.org/show_bug.cgi?id=3519
Bug ID: 3519
Summary: Command line parameter to print out full config
Product: Portable OpenSSH
Version: 9.1p1
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5
Component: ssh
Assignee: unassigned-bugs at mindrot.org
Reporter: sparr0 at gmail.com
~/.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
--
You are receiving this mail because:
You are watching the assignee of the bug.
More information about the openssh-bugs
mailing list