Overview

A comprehensive reference for transitioning SSH operations from default (compatibility-focused) configurations to professional-grade security. Covers the full hardening chain: modern cryptography, daemon hardening, architectural containment, operational efficiency, and network hygiene.

Modern Cryptographic Standards

The mandatory move from legacy RSA to Ed25519 keys — shorter, faster, and more cryptographically resilient. Keys should be generated with a passphrase on the client and distributed via ssh-copy-id. Mature setups evolve from a single key pair to role-based or device-specific keys to limit blast radius.

Daemon Hardening (sshd_config)

Every managed node must enforce a “Zero-Password” posture:

  • PasswordAuthentication no — forces key-based auth, renders brute-force attacks ineffective
  • PermitRootLogin no — prevents direct targeting of the most powerful account
  • MaxAuthTries 3 — limits failed attempts per session
  • Non-standard ports (e.g., 2222) — reduces log noise from scanning bots (security by obscurity, not primary defense)

Jump Host Architecture

The Bastion pattern — a single, highly-hardened entry point replaces multiple port-forwarded machines. The ProxyJump directive enables transparent multi-hop access (ssh -J user@jump-host internal-server), keeping internal infrastructure invisible to the public internet.

Config Alias Management

The ~/.ssh/config file as an essential management dashboard — host aliases, identity files, and server intervals abstract away IP/port complexity, enabling simple commands (ssh pi, ssh nas) to drive fleet operations.

Network Hygiene

  • DHCP Reservations: Router-level reservations over device-level static IPs for centralized, auditable addressing.
  • Fail2Ban / CrowdSec: Mandatory for internet-facing nodes — automatic ban of brute-force IPs.
  • MFA for SSH: TOTP layered on top of SSH keys for high-value nodes.