The following are some examples of how to use ufw:
First, ufw needs to be enabled. From a terminal prompt enter: sudo ufw enable
To open a port (ssh in this example): sudo ufw allow 22
Similarly, to close an opened port: sudo ufw deny 22
To remove a rule, use delete followed by the rule: sudo ufw delete deny 22
ufw can be disabled by: sudo ufw disable
It is also possible to allow access from specific hosts or networks to a port. The following example allows ssh access from host 192.168.0.2 to any ip address on this host:
sudo ufw allow proto tcp from 192.168.0.2 to any port 22
2 comments:
thanks! helped with huge logs
cool
Post a Comment