20

Is it possible to get a list of all the currently active configuration options of a running sshd task? Something like connecting, using a command via ssh and then disconnect?

I know I can read the configuration file and derive from there but:

  • There are options with defaults which are not explicitely set in the sshd_config
  • Finding the correct config file is not always easy (as it can be changed)
  • There are commandline options overriding sshd_config
  • ... ?

Thanks for your help

1
  • Do you have control over the sshd? Commented Jan 30, 2017 at 13:23

1 Answer 1

14

It is not possible to dump the configuration from running sshd, but you can instruct the sshd to parse the configuration and dump the resulting applied configuration options including default values from the default configuration file. There is -T switch for that:

sshd -T

Note: You can have commandline options overriding sshd_config.

You can use -f switch to read the configuration file from different file.

Everything is well documented in manual page for sshd.

2
  • 3
    The -T switch is what I need, thank you for that.
    – Christian Waidner
    Commented Jan 30, 2017 at 14:55
  • 2
    @Paxsali this question is about sshd, which has the -f for the config file though.
    – Jakuje
    Commented Dec 26, 2021 at 19:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .