I use CentOS 7 and would like to know if it is possible to block login via ssh (sshd) for a certain period of time after a certain amount of attempts.
EXAMPLE: After 3 wrong attempts the login is blocked for 15 minutes.
Thanks! =D
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityAs the comment above said, fail2ban
should be worth looking at. It prevents bruteforce attempts and supports whitelisting, so it should fit to your criteria.
Take a look at sshguard
, it will monitor the sshd
logs and add an iptables
rule to block connections from the ip address trying to log in for a set interval.
fail2ban
, see digitalocean.com/community/tutorials/…, this would mean you can block all incoming ssh for a period of time.