Skip to content

sshd_config checker

Free, no sign-up Runs in your browser

Paste an sshd_config and find root login, password authentication, empty passwords and weak ciphers, MACs and key exchange, judged by OpenSSH defaults.

Checked as you type. Nothing you paste leaves this page.

The file is read in your browser. It is not uploaded.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the sshd_config checker

  1. Paste /etc/ssh/sshd_config, drop the file, or load the example.
  2. Fix critical and high findings, then test a new login before closing your session.
  3. Check the files in /etc/ssh/sshd_config.d as well: an Include near the top lets them win.
  4. Run sshd -t to check the syntax, then reload the service.

About this tool

Every server with SSH open to the internet is probed for weak passwords all day, by bots that work through lists of common user names. The server’s sshd_config decides whether those attempts can ever work: whether passwords are accepted at all, whether root may log in, and which algorithms a client may negotiate.

This checker reads the file as sshd does. Keywords are case-insensitive, the first value of a keyword wins, and Match blocks are judged separately. It knows the defaults of current OpenSSH, so it does not complain about a missing PermitRootLogin (the default, prohibit-password, is fine) but does note a missing PasswordAuthentication, whose default is yes. It also catches the common trap where PasswordAuthentication is no but keyboard-interactive authentication through PAM still accepts passwords.

Weak ciphers, MACs and key exchange algorithms are reported only when a line names them, because current OpenSSH no longer enables them by default. A list that starts with a minus removes algorithms and is not flagged. The checker reads one file, not the sshd_config.d drop-ins, and does not replace a review.

Sources

Questions

What is the default for PermitRootLogin?

prohibit-password, since OpenSSH 7.0. Root can log in with a key but not with a password. Setting it to yes allows password logins for root; setting it to no blocks root over SSH completely, which is the usual choice when admins log in as themselves and use sudo.

I set PasswordAuthentication no. Why can I still log in with a password?

Keyboard-interactive authentication is a separate method, on by default, and with UsePAM yes it asks for the account password. Set KbdInteractiveAuthentication no as well (ChallengeResponseAuthentication is its deprecated alias). Also check for an earlier file in sshd_config.d that sets PasswordAuthentication yes, because the first value wins.

Which SSH ciphers and key exchange algorithms are weak?

Ciphers in CBC mode, 3des-cbc and arcfour; MACs based on MD5 or truncated to 96 bits; and key exchange with diffie-hellman-group1-sha1, which uses a 1024-bit group. Current OpenSSH leaves all of them out of its defaults, so they appear only when a config line adds them.

Does the Protocol keyword still matter?

Not on current servers. SSH protocol 1 was removed from OpenSSH in version 7.6 and the keyword is no longer documented. A line that enables protocol 1 matters only on very old systems, where it is a serious weakness; delete it either way.

Related tools