If your server allows password login over SSH, it is likely being hit by thousands of brute-force attempts every hour. SSH Key Authentication is the only secure way to manage remote access.
How It Works
SSH uses asymmetric cryptography. You have a Private Key (kept on your computer) and a Public Key (placed on the server). Access is granted only if the keys match.
Generating a Key Pair
Run ssh-keygen -t ed25519. This creates a modern, highly secure key. Never share your .id_ed25519 file with anyone!
The Security Benefit
Once you disable password authentication in /etc/ssh/sshd_config, a hacker needs your physical key file to even attempt a login. Typing a password becomes impossible, effectively ending most automated attacks.