Hardening SSH login in apex #217
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "disable-password-login"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bots didn't took long to find the SSH port. Enable fail2ban to take down repeated attempts from the same IP and disable password login to cover for potentially weak passwords.
We are seeing a lot of failed attempts from the same IPs: apex% sudo journalctl -u sshd -b0 | grep 'Failed password' | wc -l 2441LGTM
Default fail2ban config is not particularly clever:
I will also enable the bantime-increment.enable option so the ban time increases exponentially.
I think I will also increase the maxretry to 5, so when it accidentally assigns 3 bad attemps to a single attempt it doesn't lock the user.
It seems now it bans bots for quite a while as expected (10 min * 2^(5 - 1) = 160 min = 2h 40min):
Checkout
From your project repository, check out a new branch and test the changes.