Keep one working SSH session open while testing changes in a second terminal.
Validate before reload
sudo sshd -t
sudo systemctl reload sshdUse key authentication
ssh-keygen -t ed25519
ssh-copy-id administrator@example-serverDisable root login
PermitRootLogin noDisable password authentication only after keys are proven to work.
Need help applying this?
e-NetSec provides practical Linux, networking and cybersecurity consultancy.
Contact e-NetSec