How to set firewall rule in Ubuntu

 First you need to check current status of the firewall.


- sudo ufw status


if it is showing inactive or not loaded then it's turned off, OR If it is showing running /active then need to hit below commands.


- sudo ufw stop


If you don't want to disable and you want to keep it ON then you can add firewall rule with required port number.


Example- sudo ufw enable


-sudo ufw allow 22 (Here 22 is port for SSH)


in same way you can deny this port


- sudo ufw deny 22




Comments

Popular posts from this blog

Core 5 Security Epics in AWS Cloud

Why do you need to monitor your network?

How to change Domain account logging password