Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

SSH Server

Direct answer

The SSH server runs sshd, listens on TCP 22 (by default), presents its host keys and authenticates users according to sshd_config.

When to use this

Use it when setting up or hardening SSH access to a server, or when nobody can connect.

First 30 seconds

1. systemctl status sshd — running?

2. ss -ltnp | grep sshd — listening on the intended address/port?

3. Firewall: port allowed?

4. sshd -T | grep -E 'passwordauth|permitroot|allow' — policy.

5. Test from a second session before closing the first.

Operational verification

sshd started → listens → presents host key → applies auth policy → starts the user session

Evidence · next step

For SSH → SSH Server, continue with the first unproven Topic check: Verify sshd unit/process and exact listening sockets/addresses/ports. If that boundary is healthy, advance to the adjacent check: Validate effective server configuration for the target user/address context. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandss -tlnp | grep :22
Scope / prerequisiteUse it when setting up or hardening SSH access to a server, or when nobody can connect.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

service/unit → sshd process → listening socket → host keys/config → client connect/KEX → authentication/account checks → session/subsystem/forwarding policy → remote workload

Healthy evidence: sshd is running and listening as intended, host keys/config are valid, the target client reaches the endpoint, authentication/account checks pass and the requested session/subsystem succeeds.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Verify sshd unit/process and exact listening sockets/addresses/ports.

  • Validate effective server configuration for the target user/address context.
  • Correlate authentication/session events with one timestamped client attempt.
  • Confirm the original shell, command, SFTP/SCP or forwarding use case from a real client.

Verification chain. service/unit → sshd process → listening socket → host keys/config → client connect/KEX → authentication/account checks → session/subsystem/forwarding policy → remote workload

Step 3 Commands Verify boundary
sshd -T | head
ss -tlnp | grep :22
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: service is active but bound to the wrong address, Match policy changes one user path, account restrictions block session creation or only the transport layer is healthy.

Step 5 Common mistakes Narrow the fault
  • Exposing SSH to the internet without restrictions.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Validate before restarting: sshd -t. Keep an existing session open when changing it. Restrict who may log in (AllowUsers/AllowGroups), disable passwords for internet-facing hosts and open the port in the firewall.

Key checks
  • ssh -v user@host — client-side connection and authentication steps
  • journalctl -u ssh -u sshd -e — server log
  • sshd -T — effective server settings
  • ss -ltnp | grep :22 — sshd listening
ReferenceWhat it is1 section · depth on demand

Core model

Verify the service from outside-in and inside-out: listening endpoint and firewall path, sshd process/unit, host keys and effective configuration, authentication/account policy, then session/subsystem setup. Treat daemon liveness as separate from successful remote workload execution.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Server liveness/listening shows availability of the daemon endpoint only, but it does not show client trust, successful authentication, permitted session setup or workload correctness.

In depth

Securing an SSH server: key settings and defaults

A secure SSH server mostly comes down to a handful of sshd_config settings. The sshd_config(5) manual page documents their defaults:

KeywordDefaultHardened choice
PermitRootLoginprohibit-passwordno, with sudo for privilege
PasswordAuthenticationyesno once keys are deployed
KbdInteractiveAuthenticationyesno unless used for MFA
PubkeyAuthenticationyesyes
AuthenticationMethodsanye.g. publickey,keyboard-interactive for key + OTP
MaxAuthTries63–4
LoginGraceTime120 s30–60 s
AllowTcpForwardingyesno, or local where needed
X11Forwardingnono
AllowUsers / AllowGroupsEveryoneA dedicated group such as ssh-users
LogLevelINFOVERBOSE logs key fingerprints used to log in

Access control order

DenyUsers and DenyGroups take precedence over the Allow lists. Once any Allow list is set, only matching users or groups can log in at all, including administrators you forgot to add.

Testing before reloading

sshd -t checks the configuration for errors. sshd -T prints the effective configuration, which is useful because Include files and the first-value rule make the result non-obvious. Keep an existing session open until a new login has been tested.

srv1$ sudo tee /etc/ssh/sshd_config.d/10-hardening.conf >/dev/null <<'EOF'
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
AllowGroups ssh-users
MaxAuthTries 3
LoginGraceTime 30
AllowTcpForwarding no
LogLevel VERBOSE
EOF
srv1$ sudo sshd -t && echo syntax-ok
srv1$ sudo sshd -T | grep -E "^(permitrootlogin|passwordauthentication|allowgroups|maxauthtries)"
permitrootlogin no
passwordauthentication no
allowgroups ssh-users
maxauthtries 3
srv1$ sudo systemctl reload ssh
admin$ ssh -o PreferredAuthentications=password srv1
admin@srv1: Permission denied (publickey).

Why use a drop-in file

A file in sshd_config.d survives package upgrades that replace the main file. It must be included before the defaults it overrides, because of the first-value rule. Most distributions put the Include line at the top of sshd_config for exactly that reason.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

SSH Server is part of SSH → SSH Server. An SSH server exposes remote SSH service through sshd, combining listening sockets, host keys, authentication backends, account restrictions, session setup, subsystems and forwarding policy.

Topic-specific state model. An SSH server exposes remote SSH service through sshd, combining listening sockets, host keys, authentication backends, account restrictions, session setup, subsystems and forwarding policy.

Interpretation rule. - sshd process running ≠ listening on the expected address/port.

  • Listening socket reachable ≠ SSH negotiation/authentication succeeds.
  • Authentication accepted ≠ account/session setup or requested subsystem succeeds.
  • One user can log in ≠ another user/address/Match context has the same effective policy.

Quick reference

SSH server operation:

systemctl status sshd           # 'ssh' on Debian/Ubuntu
ss -tlnp | grep sshd
sshd -t                          # config syntax test
sshd -T | grep -E 'port|permitroot|passwordauth|listenaddress'
journalctl -u sshd -f
ls -l /etc/ssh/ssh_host_*_key.pub

Ubuntu 22.10+ uses socket activation (ssh.socket) — port changes go in a socket drop-in or systemctl disable --now ssh.socket to return to the classic daemon. Keep an existing session open while changing sshd config.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Server liveness/listening shows availability of the daemon endpoint only, but it does not show client trust, successful authentication, permitted session setup or workload correctness.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. SSH Server owns the server role and service exposure. sshd owns daemon lifecycle/process behavior, sshd_config owns policy, Firewall owns packet filtering and systemd & Services owns generic service-manager semantics.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in SSH → SSH Server. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.openssh.com/manual.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
ssh serveropenssh serverlinux ssh serverremote ssh service
Embedded reference data

Quick lookup tables

SSH Server operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for SSH Server.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateAn SSH server exposes remote SSH service through sshd, combining listening sockets, host keys, authentication backends, account restrictions, session setup, subsystems and forwarding policy.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact client/server + attempt time → resolve destination/TCP path → inspect effective client config → identify OpenSSH versions → verify KEX + host-key trust → trace offered/accepted authentication → inspect effective sshd policy for user/source → verify session/subsystem/forward → verify remote process/filesystem/service → repeat original workload.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainservice/unit → sshd process → listening socket → host keys/config → client connect/KEX → authentication/account checks → session/subsystem/forwarding policy → remote workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryServer liveness/listening proves availability of the daemon endpoint only; it does not prove client trust, successful authentication, permitted session setup or workload correctness.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux SSH evidence can establish this proof path: service/unit → sshd process → listening socket → host keys/config → client connect/KEX → authentication/account checks → session/subsystem/forwarding policy → remote workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured transport, trust, authentication, policy, session, filesystem or workload scope. Server liveness/listening proves availability of the daemon endpoint only; it does not prove client trust, successful authentication, permitted session setup or workload correctness.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: correlate client and server evidence for the same attempt, inspect effective client/server configuration and identity/trust/authentication state, then test the exact requested session, transfer or forward before changing additional layers.Continue to the next unresolved boundary while preserving the original test condition.

SSH Server · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundarySSH Server
Topic pathSSH → SSH Server
Runtime stateAn SSH server exposes remote SSH service through sshd, combining listening sockets, host keys, authentication backends, account restrictions, session setup, subsystems and forwarding policy.
Fast checks- Verify sshd unit/process and exact listening sockets/addresses/ports. - Validate effective server configuration for the target user/address context. - Correlate authentication/session events with one timestamped client attempt. - Confirm the original shell, command, SFTP/SCP or forwarding use case from a real client.
Verification chainservice/unit → sshd process → listening socket → host keys/config → client connect/KEX → authentication/account checks → session/subsystem/forwarding policy → remote workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryServer liveness/listening proves availability of the daemon endpoint only; it does not prove client trust, successful authentication, permitted session setup or workload correctness. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?