SSHD_CONFIG CHECK · RUNS IN YOUR BROWSER

What will your SSH server really do?

sshd keeps the first value it reads for a setting and silently ignores the rest. On Ubuntu and Debian the first line of sshd_config pulls in every sshd_config.d/*.conf file, so a cloud-init drop-in that says PasswordAuthentication yes beats your no further down.

A drop-in named hardening without .conf is never read, and a line written flush left after a Match block still belongs to it. Paste /etc/ssh/sshd_config and its drop-ins below: this page reads them in sshd's order and shows which value wins, the lines that do nothing, and the settings that let people in more easily than you meant.

Nothing is uploaded. What you paste is read in this browser and never leaves your device, and the tool makes no network calls of its own. It reads the files, not a running server: it is not sshd -T and not a security audit.

1. Paste your sshd_config files

Name each block like its path under /etc/ssh. The block named sshd_config is read first, and its Include lines pull in the blocks they match (sshd_config.d/50-cloud-init.conf), in name order, the way sshd does. On the server, sudo head -n 200 /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* shows them.

Optional: check one connection against the Match blocks

Fill in what you know about a login. Blocks whose criteria you leave blank count as not matching.

Paste at least sshd_config above and click Check.

What it checks

The reading follows OpenSSH 9.6p1's own parser (servconf.c, match.c) and the sshd_config(5) manual of that release: first value wins, case-insensitive keywords, an optional =, quotes and trailing comments, Include globs relative to /etc/ssh in byte order, a Match block running to the next Match or the end of its file, Match all, and Match values replacing global ones. This tool is not affiliated with the OpenSSH project. Every type, with the sshd behaviour behind it: sshd_config mistakes explained.

Prefer a CLI, or want this in your own CI?

Same engine, zero dependencies, Node 18 or later:

sudo node check.mjs /etc/ssh                    # sshd_config and everything it Includes
node check.mjs ./ssh                           # a copy in your repo, read as /etc/ssh
node check.mjs /etc/ssh --user deploy --addr 10.20.1.5   # what one login gets
node check.mjs /etc/ssh --format json          # machine-readable
node check.mjs ./ssh --fail-on-risk            # exit 2 on an error, high or medium finding

Get check.mjs and scan.mjs from the repo: nothing to install, no network calls, and it never runs sshd. On the server, sudo sshd -t checks syntax and sudo sshd -T prints the values it will use.

Common questions

Why is my PasswordAuthentication no ignored?

sshd keeps the first value it reads for a setting and ignores later ones, the opposite of most config files. On Ubuntu and Debian, the first line of /etc/ssh/sshd_config is Include /etc/ssh/sshd_config.d/*.conf, so any drop-in that says PasswordAuthentication yes (cloud-init writes one, 50-cloud-init.conf, when an image asks for password logins) wins over your line further down. Put your setting in a drop-in that sorts first, such as 00-hardening.conf, or remove the other one, then check with sudo sshd -T | grep -i passwordauthentication.

Why is my file in sshd_config.d not read?

The stock Include line matches only names ending in .conf, so /etc/ssh/sshd_config.d/hardening or hardening.cfg is never read. Rename it, for example to 10-hardening.conf.

Does indentation end a Match block?

No. sshd ignores indentation: every line after a Match line belongs to that block until the next Match line or the end of the file. A setting written flush left after an indented Match body applies only to the connections that Match selects. Put global settings above the first Match, or write Match all before them.

Is PasswordAuthentication no enough to stop password logins?

Not always. With UsePAM yes (the Ubuntu and Debian default), keyboard-interactive login asks PAM, which asks for the Unix password. KbdInteractiveAuthentication defaults to yes; Ubuntu's stock file sets it to no, but older files and other distributions may not. Set both to no unless PAM drives a second factor.

Does a clean result mean my SSH server is secure?

No. It reads only the patterns listed on this page, from the files you paste. It does not know your OpenSSH version's compiled-in defaults if they differ from 9.6, the keys in authorized_keys, your PAM stack, firewall or fail2ban, or which users have passwords. Confirm with sshd -T on the server, and have a qualified person review anything that protects valuable data.