Question

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

Posted October 14, 2021 108 views
LAMP StackLaravel

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)

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.

×
Submit an Answer
1 answer

Hello,

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

https://docs.digitalocean.com/products/droplets/how-to/connect-with-console/

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