Question

sudo ufw status return 'inactive'

Trying to set up Nginx in Ubuntu 16.04 following the tutorial given in https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04 everyhting is fine but running the command

sudo ufw status

gives inactive.

What is wrong?

Thank you

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

sudo ufw enable
sudo ufw default deny

And I then do:

sudo iptables -L

Not Sure… Source: https://ubuntuforums.org/showthread.php?t=1514714

All I needed was:

$ sudo ufw enable

I then got the following prompt:

Command may disrupt existing ssh connections. Proceed with operation (y|n)?

After hitting “y” I saw:

Firewall is active and enabled on system startup

And sudo ufw status gave me the expected output.

Well this might be quite old to reply but do remember to add sudo ufw allow 22/tcp otherwise you will not be able to do ssh into your vm once you exit out of it.