Allows you to benefit from ufw's limit
protection without being too restrictive.
- Make rule
ufw limit from YOUR_IP to any port 22 proto tcp
- Increase limit
- Quick and easy:
sed -i 's/--seconds 30 --hitcount 6/--seconds 20 --hitcount 20/' /etc/ufw/user.rules
- Optionally, only rules with YOUR_IP:
sed -i '/YOUR_IP/s/--seconds 30 --hitcount 6/--seconds 20 --hitcount 20/' /etc/ufw/user.rules
- Optionally, only rules with YOUR_IP:
- Or, manually edit:
nano /etc/ufw/user.rules
- Quick and easy:
- Apply changes
systemctl restart ufw
The default rate limit of 6 connections per 30 seconds will cause "random disconnect" issues with PyInfra, Ansible, rsync, etc. as many of these agent-free systems rely on 1 SSH connection per command.
Take note, Canonical.