Cybersecurity 1 min read STABLE Updated 2026-07-25

SSH Hardening Runbook: Code, Checklists, Tables

Demo article for copyable code blocks, interactive checklists, callouts, and operational tables.

D
DailyOps
Published 2026-07-25
A

Goal

Harden SSH on a Linux bastion without locking yourself out. This runbook showcases DailyOps ops reading kit: copyable code, interactive checklist, callouts, and tables.

Quick decision matrix

SituationActionPriority
Internet-facing hostKeys only + fail2banP1
Internal bastionKeys only, MFA jumpP2
Lab / ephemeralMinimal documented hardeningP3

Interactive checklist

Tick items as you go (browser-local state only, nothing is sent to the server):

  • Inventory accounts with a shell
  • SSH keys deployed for admins
  • PasswordAuthentication no tested on a second session
  • fail2ban or equivalent enabled
  • Break-glass procedure documented

Reference config

bash
# /etc/ssh/sshd_config.d/99-hardening.conf
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 2
AllowUsers opsadmin jumpuser

After editing:

bash
sshd -t && systemctl reload sshd

Control table

ControlWhere to checkOK when
Key authsshd -T | grep passwordauthenticationno
Root loginsshd -T | grep permitrootloginno or prohibit-password
Banner/etc/issue.netLegal notice present

Common traps

  1. Disabling passwords before keys are deployed.
  2. Forgetting service accounts with shells.
  3. Applying a CIS template with no rollback window.

End of runbook

When the checklist is green, record date, operator, and config hash in the change ticket. The next article connects this kind of content to the rest of the DailyOps knowledge base (links, notes, CTA).

Back to articles