Understanding and Preventing Brute-Force Attacks
A brute-force attack is a trial-and-error method used to guess login credentials. Attackers use automated scripts to try thousands of common passwords.
Prevention Methods
- Use Strong, Unique Passwords: This is your first and best defense.
- Use SSH Keys: (Link to: Advanced SSH Security and Key Management|Disabling password authentication entirely not found) makes password-based brute-force attacks impossible.
- Install Fail2Ban: This software automatically blocks IP addresses that show malicious signs, such as too many password failures.
- Change Default Ports: Changing the default SSH port from 22 to something else can reduce the number of automated bots that find your server.
- Use Two-Factor Authentication (2FA): (Link to: Setting Up Two-Factor Authentication (2FA) for SSH|Requiring a second factor not found) means a password alone is not enough to gain access.