SSH Security
Cheat sheet · https://pcornel.dk/topic.php?topic=410
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 configssh-audit <host>— algorithm auditjournalctl -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
| Boundary | Question | Evidence | Does not prove |
|---|---|---|---|
| Definition | What is configured or intended? | running configuration / controller policy | live operation |
| Local state | Is the feature active at the expected scope? | sshd -T | remote success |
| Counters | Did controlled traffic or an event reach this stage? | scoped counters/timestamps | complete return path |
| Next boundary | What consumes or transports this state? | asset/identity → authentication/trust → authorization/policy match → enforcement/session → telemetry/detection → response/recovery | application success |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=410