Skip to content
BENIBIX Learn

sshd_config

Infrastructure🔑 SSH & Remote AccessSSH Login Security

Also known as /etc/ssh/sshd_config, SSH Server Config, PermitRootLogin

The settings file for the SSH server. It decides who may log in and how.

Think of it like

Think of it like the rule sheet on the doorman's desk. It says who may come in and how.

Example

Jack sets PermitRootLogin to no and reloads SSH. Now nobody can log in straight to root, even with the right key.

Why it matters

A few lines here decide how hard the server is to break into.

Definition

sshd_config is the settings file for the SSH server. It lives at /etc/ssh/sshd_config. Each line turns one rule on or off, like whether root may log in. Changes only count after you reload the SSH service. A mistake here can lock everyone out, so test before you log out.

Example code

console
$ grep -E '^(PermitRootLogin|PasswordAuthentication)' /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
$ sudo systemctl reload ssh
Two lines that close the doors most attacks try. Then reload so they take effect.
Inside the server, sshd_config holds the switches. Two are off: password login and root login.

Common mistake

Editing it and closing the last open session before testing. If a line is wrong, you are locked out.

Key takeaways

  1. 1
    Server side. Lives in /etc/ssh.
  2. 2
    Reload to apply. Edits do nothing until then.
  3. 3
    Test first. Keep one session open.

Compare

Learn it properly