I was trying to enhance the security of my droplet by setting up firewall rules via DigitalOcean Cloud Firewalls. Here are the commands I used to add the rules:
# Adding a rule to allow SSH sudo ufw allow 22/tcp
After making these changes, I found that I could not connect to the droplet via SSH. I get a “Connection timed out” error when trying to connect. I’m sure I correctly added port 22 to the allowed list, but the connection still fails.
Could anyone have encountered a similar issue or suggest what I might have done wrong? Are there any firewall settings or additional steps that need to be taken?
Thanks in advance for any help!
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.
Hi there,
You mentioned that you added a Cloud Firewall, note that if you have both ufw and a Cloud Firewall, even if UFW allows SSH, DigitalOcean Cloud Firewalls could be blocking it.
Check in the DigitalOcean Control Panel and ensure Inbound Rules allow:
Let me know how it goes after you’ve allowed the SSH connections for both the
ufw
on your Droplet and the Cloud Firewall!- Bobby
Heya, @nikolasj
As Bobby mentioned if you run a Cloud Firewall there might be a miscofiguration in the firewall rules and you need to check if both configs allow the ssh access.
Regards
It sounds like you might have a conflict between
ufw
(Uncomplicated Firewall) and DigitalOcean’s Cloud Firewalls. Ensure that DigitalOcean’s Cloud Firewall rules also allow SSH (port 22) and thatufw
is not blocking the connection. You can check the status ofufw
withsudo ufw status
and disable it temporarily withsudo ufw disable
to test if it’s the issue. Additionally, verify your droplet’s network settings in the DigitalOcean control panel.