keepsite.fr — SSH hardening checklist (Debian / OpenSSH) ========================================================= Before you start [ ] A second SSH session is open and logged in as a sudo-capable user. [ ] You have physical or out-of-band (KVM / rescue) access to the server. [ ] A backup of /etc/ssh/sshd_config exists: cp -a sshd_config sshd_config.bak Keys [ ] ssh-keygen -t ed25519 -a 100 -C "admin@keepsite.fr" [ ] ssh-copy-id user@server-ip [ ] Test: ssh -o PreferredAuthentications=publickey user@server-ip Server configuration (/etc/ssh/sshd_config) [ ] PubkeyAuthentication yes [ ] PasswordAuthentication no [ ] PermitRootLogin no [ ] KbdInteractiveAuthentication no [ ] X11Forwarding no (unless you really need it) [ ] AllowUsers your-user (optional but effective) Validate and reload [ ] sudo sshd -t # syntax check: silence = OK [ ] sudo systemctl reload ssh [ ] Open a NEW session and confirm key login works. [ ] Only then close the original session. Notes ----- * Debian 12 uses the "ssh" service name (ssh.service), not sshd.service. * If key login fails, check permissions: ~/.ssh 700, authorized_keys 600. * Keep a root console open until the new configuration is proven working.