Answer the question
In order to leave comments, you need to log in
How to block by IP in centos 7?
When entering the server via putty, the following message appeared:
Last failed login: Fri Sep 30 07:20:08 UTC 2016 from 123.31.34.46 on ssh:notty
There were 1596 failed login attempts since the last successful login.
Tell me how to block access.
Answer the question
In order to leave comments, you need to log in
Have you tried this command?:iptables -I INPUT -s 123.31.34.46 -j DROP
natively use firewalld on centos7
configure firewalld first, then install:
fail2ban-firewalld.noarch : Firewalld support for Fail2Ban
fail2ban-systemd.noarch : Systemd journal configuration for Fail2Ban
can for alerts:
fail2ban-mail.noarch : Mail actions for Fail2Ban
fail2ban-sendmail .noarch : Sendmail actions for Fail2Ban
Next, configure fail2ban jails actions filters as you wish.
easy to check:
fail2ban-client status
Status
|- Number of jail: 10
`- Jail list: dovecot, nginx-botsearch, nginx-http-auth, php-url-fopen, postfix, recidive, roundcube, sshd, sshd-ddos, testproxy
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question