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!
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:
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.
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!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.