The OpenSSH daemon has many "default" values for its settings. So looking at the sshd_config might not give someone the complete set of active settings.
How to display the full sshd configuration (for OpenSSH)?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThe OpenSSH sshd
command has an extended test switch which can be used to "Check the validity of the configuration file, output the effective configuration to stdout and then exit." (source sshd man page).
So the answer is (as root, or prefixing it with sudo):
sshd -T
(the settings are not in alphabetical order, one can use sshd -T | sort
to quickly look for one setting, or just grep
the setting) :-)
PS: my first reflex was looking for this answer online, but the search engines were not helpful. And then only looked at the man page and found the answers. For those lazy like me which turns too quickly to the internet, there is now the answer posted online! Lesson learned today: check the man page first, ask a search engine later if needed.
grep
, add the -i
option because the mixed case used in the config. file is not preserved. The option names given by -T
are in all lowercase. So for example, use sshd -T | grep -i UseDNS
or write the option name in lowercase: sshd -T | grep usedns
.
-C
, for example: sudo sshd -T -C user=username
May 28 at 10:57