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