How to prevent attacks on linux systems
Always look at the login log: /var/log/secure
If you see that the login fails, it is regarded as the IP that needs to be attacked and defended.
例如
Failed password for root from 107.155.66.20 port 44080 ssh2
Then I should prevent ip 107.155.66.20
How to prevent it?
use /etc/hosts.deny
As long as the ip in /etc/hosts.deny is denied access:
Take a look at the effect of using /etc/hosts.deny:
Attached is the hosts.deny file