Report this

What is the reason for this report?

How to Disable SSH Rate Limit for Specific IP Address

Posted on May 3, 2021
Andrew Versalle

By Andrew Versalle

Senior Software Engineer

I’ve recently purchased 3 droplets w/ the Ubuntu 20.04 LAMP stack. By default, UFW is set up to allow SSH connections, rate limited. This is great, but I’m running into issues where my deployment scripts are failing because they’re creating too many SSH connections in too short of a time.

Is there a way to disable rate limiting just for a specific IP address? Or is there another way I could disable rate limiting when connecting from my WiFi or computer?

Or would I have to disable rate limiting completely for SSH? If so, is this a huge security concern?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In your case, you can whitelist a specific IP address to bypass the rate-limiting rule for SSH connections. To do this, you’ll need to modify the UFW rules. Here’s how:

  1. First, insert a rule that allows all SSH traffic from a specific IP address:

sudo ufw insert 1 allow from your_IP to any port 22 proto tcp

Replace your_IP with the IP address you want to whitelist.

  1. Then, you can remove or disable the rate-limiting rule for SSH in UFW:

sudo ufw status numbered

Find the number of the rule that contains “LIMIT” and “22/tcp”, then delete that rule using:

sudo ufw delete [RULE_NUMBER]

Disabling the rate-limiting completely for SSH might expose your server to brute-force attacks. I recommend only whitelisting the IP addresses you require for your deployment scripts and keeping rate-limiting enabled for other connections.

For more information, you can check out the DigitalOcean Firewall Configuration Tutorial.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.