Check default setting of sshd service

Dec 20, 2021

The Secure Shell Daemon application (SSH daemon or sshd) is the daemon program for ssh. All the configurations have kept under the ssh directory /etc/ssh/ where the main ssh server daemon configurations defined in /etc/ssh/sshd_config file.

In the sshd_config file defined variables (parameters) and its values adjusts the default behavior of the SSHD daemon.  However some situations, we may need to check the default values of sshd service which are not defined in sshd_config file.

To check all the variables and its value effected for sshd service can be seen from below command.

#sshd -T

This command checks the validity of the configuration file, outputs the effective configuration either specified in config file or binary program defaults to stdout and then exit.

Example : sshd default values 

The same command output can be sorted to list by order way to quickly understand the required values.

#sshd -T | sort

The above command sort the output for better understanding.

While troubleshooting, it's very helpful to check some max allowed values.

root@ip-172-31-8-64:~# sshd -T | sort | grep -i max
clientalivecountmax 3
maxauthtries 6
maxsessions 10
maxstartups 10:30:100
root@ip-172-31-8-64:~#

The above command results the sshd effective values and sorting by ascending order and finally filters with the word matching with "max".

verify with sort and filter by max word matching

Here you go and enjoy troubleshooting !!!

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.