New server installed? You don’t want to play with iptables, yet you want your firewall active?
ufw is the standard tool on ubuntu and it does the job.
In case you’re logged in from a remote host, take the following precaution.
root@robbyx:/etc# ufw allow 22 Rules updated Rules updated (v6) root@robbyx:/etc# ufw status Status: inactive root@robbyx:/etc# ufw allow 80 Rules updated Rules updated (v6) root@robbyx:/etc# ufw allow 443 Rules updated Rules updated (v6) root@robbyx:/etc# root@robbyx:/etc# ufw enable Command may disrupt existing ssh connections. Proceed with operation (y|n)? y Firewall is active and enabled on system startup root@robbyx:/etc# root@robbyx:/etc# ufw status Status: active To Action From -- ------ ---- 22 ALLOW Anywhere 80 ALLOW Anywhere 443 ALLOW Anywhere 22 ALLOW Anywhere (v6) 80 ALLOW Anywhere (v6) 443 ALLOW Anywhere (v6) root@robbyx:/etc# root@robbyx:/etc# ufw logging on Logging enabled root@robbyx:/etc#
Now remove all the ufw logging from /var/log/syslog by editing /etc/rsyslog.d/20-ufw.conf and remove the comment before “& ~”
# Log kernel generated UFW log messages to file :msg,contains,"[UFW " /var/log/ufw.log # Uncomment the following to stop logging anything that matches the last rule. # Doing this will stop logging kernel generated UFW log messages to the file # normally containing kern.* messages (eg, /var/log/kern.log) & ~
Your ufw logs are here: /var/log/ufw.log





