[Bug 3460] New: sshd -T aborts when no hostkeys are available and does not emit any parsed configuration

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Jul 13 01:26:42 AEST 2022


            Bug ID: 3460
           Summary: sshd -T aborts when no hostkeys are available and does
                    not emit any parsed configuration
           Product: Portable OpenSSH
           Version: v9.0p1
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: sshd
          Assignee: unassigned-bugs at mindrot.org
          Reporter: dkg at fifthhorseman.net

over in https://bugs.debian.org/959726 the debian postinst script for
openssh-server is being discussed.  That postinst script needs to parse
the sshd_config file to figure out what host keys need to be created.

I'm sure this isn't the only sysadmin-related tooling that tries to do
such a task.

rather than re-implementing the configfile parser with some janky
approximation with perl, it'd be nicer to use `sshd -T` to get a
normalized form and then parse the results more simply.

However, that's not possible for the postinst script because `sshd -T`
aborts with an error and fails to emit any parsed configuration if no
hostkeys are available (error message: "sshd: no hostkeys available --

I don't know what other errors in the configuration might cause sshd -T
to abort with a failure, but it would be nice if it would go ahead and
emit the parsed configuration anyway.

(if this seems wrong to do by default for whatever reason, perhaps a
distinct option besides -T could be used to emit the parsed
configuration regardless of whether there is an error)

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

More information about the openssh-bugs mailing list