I cant SSh into the server after enabling ufw with this command (sudo ufw enable).

Good Day,

I wanted to setup SSL with lets encrypt and according to DigitalOcean’s documentation, part of the requirements for this is to make UFW active, but when I ran this command (sudo ufw status) I found out that ufw is not active so I had to enable it with (sudo ufw enable) and was able setup SSL for the server but then after this I tried to SSH into the server but I cant, I get this error (ssh: connect to host my ip addresss port 22: Connection timed out)


Submit an 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.


What you would need to do is to connect to your server via the DigitalOCean web console as described here:

This will give you direct access to your server and you will be able to run commands as normal.

Once there, you need to run the following command in order to open port 22:

sudo ufw allow 22

Hope that this helps! Best, Bobby