Skip to content
BENIBIX Learn

SSH Config File vs sshd_config

People often think these are one file, because the names are so close. ~/.ssh/config lives on your own computer and sets up how you log in. sshd_config lives on the server and sets the rules for who may log in. Editing the wrong one changes nothing you meant to change.

Infrastructure🔑 SSH & Remote Access

SSH Config File (~/.ssh/config)

A file on your own computer. It gives each server a short name and its login.

The SSH config file is a settings file on your own computer, at ~/.ssh/config. It gives each server a short nickname. Under the nickname you write the address, the user, the port and which key to use. Then ssh and the nickname is all you type. It is for the client, not the server.

Example
Lucy logs in to three servers each day. She gives each a nickname, so she types ssh shop instead of a long line.
Why it matters
It saves typing and stops mistakes, like logging in as the wrong user or with the wrong key.
Full entry
Infrastructure🔑 SSH & Remote Access

sshd_config

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

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
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.
Full entry

In one line

SSH Config File (~/.ssh/config)
A file on your own computer. It gives each server a short name and its login.
sshd_config
The settings file for the SSH server. It decides who may log in and how.