5.3 Secure SSH Configuration
SSH is the gateway to your server. It is the #1 target for brute-force attacks.
Key-Based Authentication
Section titled “Key-Based Authentication”More secure than passwords.
-
Generate Keys (on your laptop):
-
Copy Public Key to Server:
-
Test Login: You should now log in without a password.
Hardening /etc/ssh/sshd_config
Section titled “Hardening /etc/ssh/sshd_config”Edit the server config file: sudo nano /etc/ssh/sshd_config.
Restart SSH to apply:
sudo systemctl restart ssh (or sshd).