I have my ssh port changed to XXX. Then I did
ufw limit XXX/tcp
However, when I try to login, after 5/6 failed attempts I get thrown back to prompt, but I can try again. Is that supposed to be the way it works?
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 community
If I understand your description correctly, you're typing
ssh myserver.example.com and making a few failed attempts, and getting your local prompt back. That is still one TCP connection, so it counts for one against
ufw limit (the firewall doesn't know anything about authentication attempts, it works at a lower level). You need to make 6 separate ssh connections within 30 seconds to trigger the limit.