How to Secure an SSH Server: 12 Steps to Harden sshd on Linux
To secure an SSH server, switch to SSH key authentication, disable password and root logins in /etc/ssh/sshd_config, limit which users can log in, firewall port 22 to trusted addresses where possible, add fail2ban, and keep OpenSSH updated.