Pcornel
Security · Linux Security

SSH Security

Cheat sheet · https://pcornel.dk/topic.php?topic=410

Back to the Topic

Answer

SSH Security protects remote shell, command, transfer and tunnel access through host-key verification, user authentication, authorization, algorithm policy, privilege separation, forwarding restrictions, logging and key lifecycle.

Remember

  • SSH encrypted ≠ server identity verified or user authorized safely.
  • Public-key authentication ≠ key unique, protected, current or command-restricted.
  • Configuration file present ≠ parsed, loaded and effective runtime state.
  • One allow/deny result ≠ complete DAC, privilege, LSM, firewall and application outcome.

First checks

  • sshd -T | grep -E 'permitrootlogin|passwordauthentication|pubkeyauthentication|kexalgorithms' — effective config
  • ssh-audit <host> — algorithm audit
  • journalctl -u ssh --since -1h — logins

Verify in this order

client → key auth → sshd policy → shell

Where it usually breaks

First mismatch in platform/workload identity → desired configuration → management/control plane → runtime enforcement → telemetry → workload/resource outcome; preserve identity/policy/pre-state before mutation.

SSH Hardening evidence chain

BoundaryQuestionEvidenceDoes not prove
DefinitionWhat is configured or intended?running configuration / controller policylive operation
Local stateIs the feature active at the expected scope?sshd -Tremote success
CountersDid controlled traffic or an event reach this stage?scoped counters/timestampscomplete return path
Next boundaryWhat consumes or transports this state?asset/identity → authentication/trust → authorization/policy match → enforcement/session → telemetry/detection → response/recoveryapplication success

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=410

Confirmation

Confirm action

Continue?